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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to use two different date fields in Date range slicer

Hi Experts,

I have two date fields in my dashboard Like created date and credited date, we need user to select date field in the date range filter. I cannot use both filter simultaneously. How to achieve this??

 

Thanks in advance. 

1 REPLY 1

Hi @Anonymous 

 

This is a common requirement and there are a couple of ways to achieve this, though for all of these you need to create a date table (e.g. see here for creating one in DAX)

 

Once you have this you have a few options:

 

1) Create two relationships between this date table and your main table on both date fields Only only one can be active (e.g. created date), or both can be inactive. You then need to active the relationship on demand in your DAX Formula using the USERELATIONSHIP function e.g. CALCULATE(COUNTROWS(Sales),USERELATIONSHIP(Date[Date],Sales[Created Date]). See here for details on this function

 

2) Create a copy of the date table by going to modelling -> New Table and setting the new table equal to the original one. One date table can be connected to created date and one to credited date. (This is best if you need to analyse the dates separately e.g. consider all those orders credited in one month which were created in another, though not so much if you want to look at both in a single graph/have the user select only one date range)

 

3) Have a single date table but don't create any relationships between this and the main table. Instead use a function in DAX to create a virtual relationship - e.g. TREATAS (see https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/). 

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.