• About
  • Advertise
  • Privacy & Policy
  • Contact
Wednesday, January 7, 2026
  • Login
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
Advertisement
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
No Result
View All Result
Home Machine Learning

How to Filter for Dates, Including or Excluding Future Dates, in Semantic Models

AiNEWS2025 by AiNEWS2025
2026-01-05
in Machine Learning
0
How to Filter for Dates, Including or Excluding Future Dates, in Semantic Models
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


Imagine that we have three measures:

  1. Sales Amount
  2. Sales Amount Budget
  3. Sales Amount PY

When we look at a table with these numbers, we see this (assuming that we have current data until the end of July 2025):

Figure 1 – Starting point. Notice that the Budget and the PY data go beyond the current data, which exists only until the end of July 2025 (Figure by the Author)

While the results are correct, my users might need two different views:

  1. See only the results according to the existing data
  2. Including the Budget data and the PY data

I have multiple ways to do it:

  1. Create separate Visuals with different filters.
  2. Create two pages for the two views, again by using different filters.
  3. Tell my users to use the Calendar slicer to filter the data as needed.

But I want to design my reports as user-friendly as possible without duplicating anything.

Therefore, I want to add a Slicer so users can choose whether to include future data or only see current data.

Create the Date Filter table

My Date table includes Index columns for different periods: Days, Weeks, Months, Quarters, and Years.

  • The row with the current period contains a 0
  • Rows for past periods contain negative numbers
  • Rows for futures periods contain positive numbers

Let’s see the rows for a small sample realized in SQL by using the DayIndex column:

Figure 2 – Sample rows from the Date table (Figure by the Author)

Using this column, I constructed a table with an additional column to serve as a Slicer.

I took all rows with an Index up to 0 and marked them as “Current Data only”.

Then I appended (UNION) all rows from the Date table and marked them as “Future Data included”.

Figure 3 – Complete selection for the Date Filter table (Figure by the Author)

I did it with SQL, but you can do it in Power Query or any other language of your choice.

Now, I imported this table into Power BI

Expand the data model

After adding this table to Power BI, I created a new Relationship between the new table and the Date table:

Figure 4 – Creation of the Relationship between the new Date Filter and the Date table (Figure by the Author)

The Cross-filter Direction must be set to Both as the column DateKey in the Date Filter table is not unique:

Figure 5 – Relationship with the  Cross-filter direction set to both (Figure by the Author)

Therefore, the filter direction would be Date -> Date Filter only, which will not work.

I want to filter the Date table by the Date Filter table. Therefore, I must set the filter direction to “Both”.

Result

Next, I added a Slicer to the report:

Figure 6 – The new Slicer set a Tile for the DateFilter column (Figure by the Author)

After all the preparation, the Slicer allows the selection of the data as needed:

Figure 7 – No future numbers are shown when “Current Data only” is selected (Figure by the Author)
Figure 8 – All data is shown when “Future Data included” is selected (Figure by the Author)

The users can use this slicer to choose which data they want to see, regardless of the selection in the Calendar slicer.

Selecting full periods

The example above is practical when the selection must be at the day level.

This is useful especially when comparing the current data with the Budget or PY.

Imagine on the 5th or 6th day of the month. You have only a few days of Sales, but you compare it to the Budget of the whole month. This can be misleading.

But what happens when the filter must be set to full periods, like months or years?

Here, a modified query to set the DateFilter column based on whole years:

Figure 9 – Query to set the whole year for the DateFilter column (Figure by the Author)

Now the entire year is shown, when only the current data should be shown:

Figure 10 – The whole year is shown when using the modified query from above (Figure by the Author)

You can change the Date Filter table in the same way to filter by months or other periods.

This can be done very easily by filtering the rows in the Date table for the current date.

Conclusion

This approach is straightforward to implement and easy for Report consumers to use.

It avoids writing DAX code and relies entirely on information in the Date table.

The trick is to extend the data model to support the requirements with the least effort.

If you don’t have the Index columns as I do, you can use a different approach to generate the Date Filter table. For example, use a function to get the current date, like GETDATE() in T-SQL or Now() in other languages.

I found the Index columns very useful, not only in this case but also in many other situations where the client requires me to filter the data by dates relative to the current date.

This makes life easy when the “current date” is not today, but must follow a specific logic—for example, the previous weekday.

OK, you can add relative Filters to the report. In many cases, they are enough.

In other cases, the Index columns give me more flexibility.

References

Like in my previous articles, I use the Contoso sample dataset. You can download the ContosoRetailDW Dataset for free from Microsoft here.

The Contoso Data can be used freely under the MIT License, as described in this document. I changed the dataset to shift the data to contemporary dates.

Source link

#Filter #Dates #Including #Excluding #Future #Dates #Semantic #Models

Tags: Business AnalyticsData Modelingdata sciencePower BiSemantic Model
Previous Post

Researchers spot Saturn-sized planet in the “Einstein desert”

Next Post

[2410.12869] Towards Acyclic Preference Evaluation of Language Models via Multiple Evaluators

AiNEWS2025

AiNEWS2025

Next Post
[2410.12869] Towards Acyclic Preference Evaluation of Language Models via Multiple Evaluators

[2410.12869] Towards Acyclic Preference Evaluation of Language Models via Multiple Evaluators

Stay Connected test

  • 23.9k Followers
  • 99 Subscribers
  • Trending
  • Comments
  • Latest
A tiny new open source AI model performs as well as powerful big ones

A tiny new open source AI model performs as well as powerful big ones

0
Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

0
Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

0
Best Headphones for Working Out (2024): Bose, Shokz, JLab

Best Headphones for Working Out (2024): Bose, Shokz, JLab

0
Meet the AI-powered robotic dog ready to help with emergency response

Meet the AI-powered robotic dog ready to help with emergency response

2026-01-07
The Download: War in Europe, and the company that wants to cool the planet

The Download: War in Europe, and the company that wants to cool the planet

2026-01-07
HNSW at Scale: Why Your RAG System Gets Worse as the Vector Database Grows

HNSW at Scale: Why Your RAG System Gets Worse as the Vector Database Grows

2026-01-07
Bose open-sources its SoundTouch home theater smart speakers ahead of end-of-life

Bose open-sources its SoundTouch home theater smart speakers ahead of end-of-life

2026-01-07

Recent News

Meet the AI-powered robotic dog ready to help with emergency response

Meet the AI-powered robotic dog ready to help with emergency response

2026-01-07
The Download: War in Europe, and the company that wants to cool the planet

The Download: War in Europe, and the company that wants to cool the planet

2026-01-07
HNSW at Scale: Why Your RAG System Gets Worse as the Vector Database Grows

HNSW at Scale: Why Your RAG System Gets Worse as the Vector Database Grows

2026-01-07
Bose open-sources its SoundTouch home theater smart speakers ahead of end-of-life

Bose open-sources its SoundTouch home theater smart speakers ahead of end-of-life

2026-01-07
Footer logo

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow Us

Browse by Category

  • AI & Cloud Computing
  • AI & Cybersecurity
  • AI & Sentiment Analysis
  • AI Applications
  • AI Ethics
  • AI Future Predictions
  • AI in Education
  • AI in Fintech
  • AI in Gaming
  • AI in Healthcare
  • AI in Startups
  • AI Innovations
  • AI News
  • AI Research
  • AI Tools & Automation
  • Apps
  • AR/VR & AI
  • Business
  • Deep Learning
  • Emerging Technologies
  • Entertainment
  • Fashion
  • Food
  • Gadget
  • Gaming
  • Health
  • Lifestyle
  • Machine Learning
  • Mobile
  • Movie
  • Music
  • News
  • Politics
  • Review
  • Robotics & Smart Systems
  • Science
  • Sports
  • Startup
  • Tech
  • Travel
  • World

Recent News

Meet the AI-powered robotic dog ready to help with emergency response

Meet the AI-powered robotic dog ready to help with emergency response

2026-01-07
The Download: War in Europe, and the company that wants to cool the planet

The Download: War in Europe, and the company that wants to cool the planet

2026-01-07
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.