• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
Thursday, January 15, 2026
newsaiworld
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
Morning News
No Result
View All Result
Home Machine Learning

The right way to Filter for Dates, Together with or Excluding Future Dates, in Semantic Fashions

Admin by Admin
January 4, 2026
in Machine Learning
0
Vladislav babienko ktpsvecu0xu unsplash.jpg
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter

READ ALSO

Glitches within the Consideration Matrix

When Does Including Fancy RAG Options Work?


Think about that we’ve got three measures:

  1. Gross sales Quantity
  2. Gross sales Quantity Finances
  3. Gross sales Quantity PY

After we have a look at a desk with these numbers, we see this (assuming that we’ve got present knowledge till the tip of July 2025):

Determine 1 – Start line. Discover that the Finances and the PY knowledge transcend the present knowledge, which exists solely till the tip of July 2025 (Determine by the Writer)

Whereas the outcomes are right, my customers would possibly want two totally different views:

  1. See solely the outcomes in line with the present knowledge
  2. Together with the Finances knowledge and the PY knowledge

I’ve a number of methods to do it:

  1. Create separate Visuals with totally different filters.
  2. Create two pages for the 2 views, once more by utilizing totally different filters.
  3. Inform my customers to make use of the Calendar slicer to filter the info as wanted.

However I need to design my experiences as user-friendly as doable with out duplicating something.

Subsequently, I need to add a Slicer so customers can select whether or not to incorporate future knowledge or solely see present knowledge.

Create the Date Filter desk

My Date desk contains Index columns for various durations: Days, Weeks, Months, Quarters, and Years.

  • The row with the present interval comprises a 0
  • Rows for previous durations comprise destructive numbers
  • Rows for futures durations comprise constructive numbers

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

Determine 2 – Pattern rows from the Date desk (Determine by the Writer)

Utilizing this column, I constructed a desk with a further column to function a Slicer.

I took all rows with an Index as much as 0 and marked them as “Present Knowledge solely”.

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

Determine 3 – Full choice for the Date Filter desk (Determine by the Writer)

I did it with SQL, however you are able to do it in Energy Question or every other language of your alternative.

Now, I imported this desk into Energy BI

Increase the info mannequin

After including this desk to Energy BI, I created a brand new Relationship between the brand new desk and the Date desk:

Determine 4 – Creation of the Relationship between the brand new Date Filter and the Date desk (Determine by the Writer)

The Cross-filter Route should be set to Each because the column DateKey within the Date Filter desk shouldn’t be distinctive:

Determine 5 – Relationship with the  Cross-filter path set to each (Determine by the Writer)

Subsequently, the filter path can be Date -> Date Filter solely, which won’t work.

I need to filter the Date desk by the Date Filter desk. Subsequently, I need to set the filter path to “Each”.

Outcome

Subsequent, I added a Slicer to the report:

Determine 6 – The brand new Slicer set a Tile for the DateFilter column (Determine by the Writer)

After all of the preparation, the Slicer permits the collection of the info as wanted:

Determine 7 – No future numbers are proven when “Present Knowledge solely” is chosen (Determine by the Writer)
Determine 8 – All knowledge is proven when “Future Knowledge included” is chosen (Determine by the Writer)

The customers can use this slicer to decide on which knowledge they need to see, whatever the choice within the Calendar slicer.

Deciding on full durations

The instance above is sensible when the choice should be on the day stage.

That is helpful particularly when evaluating the present knowledge with the Finances or PY.

Think about on the 5th or 6th day of the month. You could have only some days of Gross sales, however you examine it to the Finances of the entire month. This may be deceptive.

However what occurs when the filter should be set to full durations, like months or years?

Right here, a modified question to set the DateFilter column primarily based on complete years:

Determine 9 – Question to set the entire 12 months for the DateFilter column (Determine by the Writer)

Now the complete 12 months is proven, when solely the present knowledge must be proven:

Determine 10 – The entire 12 months is proven when utilizing the modified question from above (Determine by the Writer)

You’ll be able to change the Date Filter desk in the identical approach to filter by months or different durations.

This may be finished very simply by filtering the rows within the Date desk for the present date.

Conclusion

This strategy is simple to implement and simple for Report shoppers to make use of.

It avoids writing DAX code and depends completely on data within the Date desk.

The trick is to increase the info mannequin to help the necessities with the least effort.

In the event you don’t have the Index columns as I do, you should utilize a distinct strategy to generate the Date Filter desk. For instance, use a perform to get the present date, like GETDATE() in T-SQL or Now() in different languages.

I discovered the Index columns very helpful, not solely on this case but additionally in lots of different conditions the place the shopper requires me to filter the info by dates relative to the present date.

This makes life simple when the “present date” shouldn’t be right this moment, however should comply with a selected logic—for instance, the earlier weekday.

OK, you may add relative Filters to the report. In lots of circumstances, they’re sufficient.

In different circumstances, the Index columns give me extra flexibility.

References

Like in my earlier articles, I take advantage of the Contoso pattern dataset. You’ll be able to obtain the ContosoRetailDW Dataset without cost from Microsoft right here.

The Contoso Knowledge can be utilized freely beneath the MIT License, as described on this doc. I modified the dataset to shift the info to modern dates.

Tags: DatesExcludingFilterfutureincludingModelsSemantic

Related Posts

Banner3 cropped 1.jpg
Machine Learning

Glitches within the Consideration Matrix

January 14, 2026
Skarmavbild 2026 01 07 kl. 15.14.18.jpg
Machine Learning

When Does Including Fancy RAG Options Work?

January 13, 2026
Image 67.jpg
Machine Learning

The way to Leverage Slash Instructions to Code Successfully

January 12, 2026
Data modeling img 1.jpg
Machine Learning

Past the Flat Desk: Constructing an Enterprise-Grade Monetary Mannequin in Energy BI

January 11, 2026
Wmremove transformed 1 scaled 1 1024x565.png
Machine Learning

How LLMs Deal with Infinite Context With Finite Reminiscence

January 9, 2026
68fc7635 c1f8 40b8 8840 35a1621c7e1c.jpeg
Machine Learning

Past Prompting: The Energy of Context Engineering

January 8, 2026
Next Post
Ethereums toughest year since 2018 ends 2026 is starting strong.webp.webp

Ethereum’s Hardest Yr Since 2018 Ends in 2026

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR NEWS

Chainlink Link And Cardano Ada Dominate The Crypto Coin Development Chart.jpg

Chainlink’s Run to $20 Beneficial properties Steam Amid LINK Taking the Helm because the High Creating DeFi Challenge ⋆ ZyCrypto

May 17, 2025
Image 100 1024x683.png

Easy methods to Use LLMs for Highly effective Computerized Evaluations

August 13, 2025
Gemini 2.0 Fash Vs Gpt 4o.webp.webp

Gemini 2.0 Flash vs GPT 4o: Which is Higher?

January 19, 2025
Blog.png

XMN is accessible for buying and selling!

October 10, 2025
0 3.png

College endowments be a part of crypto rush, boosting meme cash like Meme Index

February 10, 2025

EDITOR'S PICK

1730282947 Generative Ai Shutterstock 2273007347 Special.jpg

New HackerRank Analysis Highlights How GenAI is Altering Software program Improvement

October 30, 2024
Btc cb 12.jpg

This is Why This Time Might Be Totally different

December 4, 2025
Bitcoin20btc id 0cac2774 e318 4edd aadb 3c04838c1021 size900.jpg

Liquidity, Clearer Rules and Extra: Crypto Executives Are Bullish for Bitcoin in 2026

January 2, 2026
Data Shutterstock 2362078849 Special.png

Domo Releases twelfth Annual “Knowledge By no means Sleeps” Report

December 19, 2024

About Us

Welcome to News AI World, your go-to source for the latest in artificial intelligence news and developments. Our mission is to deliver comprehensive and insightful coverage of the rapidly evolving AI landscape, keeping you informed about breakthroughs, trends, and the transformative impact of AI technologies across industries.

Categories

  • Artificial Intelligence
  • ChatGPT
  • Crypto Coins
  • Data Science
  • Machine Learning

Recent Posts

  • What Is a Data Graph — and Why It Issues
  • How one can Deal with Giant Datasets in Python Like a Professional
  • Ethereum Value Smashes Key Resistance as New Wallets Hit All-Time Excessive 
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

© 2024 Newsaiworld.com. All rights reserved.

No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us

© 2024 Newsaiworld.com. All rights reserved.

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?