Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Datafruit
Helper I
Helper I

Date slicer - option to choose which date should filter data

Hi

 

I have such a business problem. I would need a way to filter one dataset based on three different date fields within the same dataset. So lets say I have "order date", "shipping date" and "delivery date". No the user would want to see the data, but wants to have options, whether the date slicers filters the data based on order, shipping or delivery date. 

The options could be as a check box or something similar and once the user makes a selection then the data is filtered based on that date. 

The problem I have been having is, that I have not figured out a way how to "turn on" those inactive relationships, as the active relationship with the date table is on "order date", once the user has made a selection.

 

Does anybody have ideas how to solve this?

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Datafruit Use a disconnected table for your slicer values, order date, shipping date, etc. You can use CALCULATE and USERELATIONSHIP within a measure definition to choose the relationship based on the chosen slicer value.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Syndicate_Admin
Administrator
Administrator

1. Create a disconnected table (without relationships) that serves as a filter to define what type of date you are going to consult

2. Create a general date table where the user selects the date range to consult.

3. Create a measure that validates the type of date filter, the selected date range and then perform a Calculate with the SUM/COUNT... operation, the date filter and the required UserRelationShip relationship

Hi

Thanks for the response. Good ideas truly, but I am having troubles writing together the measure(s) to all of this. Can I hope for some luck, that the original poster perhaps posted a DAX code?

Datafruit
Helper I
Helper I

@Greg_Deckler And would all the relationships be inactive for the table? Plus for CALCULATE, what should be the first part, COUNTROWS perhaps? Would that work?

I really appreciate your response. Thank you!

@Datafruit Normally one of the relationships would be active. USERELATIONSHIP overrides the active relationship with the one that you specify. I don't know enough to tell you the first part of the CALCULATE. If you just want to count the number of rows (orders?) then sure, COUNTROWS will work just fine. Or you could use SUM to sum up some column, etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

That is the thing, I necessarily do not want to count or sum, but I want to filter the whole table based on the date the user chose and the timeframe the user wants to look at.
How would one achieve this.

Greg_Deckler
Community Champion
Community Champion

@Datafruit Use a disconnected table for your slicer values, order date, shipping date, etc. You can use CALCULATE and USERELATIONSHIP within a measure definition to choose the relationship based on the chosen slicer value.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.