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
OC_BI
Frequent Visitor

How do I use the selected period to filter other dates?

Hello,

We have a fact table where the measures are associated with 3 dates: A, B and C dates.  The report currently filters using A date.  The report sums up values from the fact table based on the selected period in the slicer (A date).  

 

The problem I'm trying to overcome is:

How do I use the selected period to filter the other dates ? 

 

I'm trying to add the same set of measures with different logic:

B date in selected period

C Date < selected period

 

For example - I selected the current year and the report displays all the measures whose A date is this year, i.e.: 01/01/2019 - 24/03/2019

Now I'd like to add all the measures with:

B date < 01/01/2019

and 

C date between 01/01/2019 - 24/03/2019.

 

I'm new to Power BI and all help will be appreciated.

 

OC

1 ACCEPTED SOLUTION
edhans
Super User
Super User

You need a single date table, and use that date field in your slicer.

If your A, B, and C dates are in separate tables, just relate them all to the Dates[Date] field in your date table.

If they are in the same table, it gets a bit trickier. You still relate all of them, but only one can be active. You can use the other "inactive" relationships in a measure with CALCULATE() in it if you use the USERELATIONSHIPS() function as one of the filters.

See this article on setting update tables.

The USERELATIONSHIPS() function will activate an inactive relationship for the current measure.

 

If you need additional help, you'll need to post some sample data in text format. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

1 REPLY 1
edhans
Super User
Super User

You need a single date table, and use that date field in your slicer.

If your A, B, and C dates are in separate tables, just relate them all to the Dates[Date] field in your date table.

If they are in the same table, it gets a bit trickier. You still relate all of them, but only one can be active. You can use the other "inactive" relationships in a measure with CALCULATE() in it if you use the USERELATIONSHIPS() function as one of the filters.

See this article on setting update tables.

The USERELATIONSHIPS() function will activate an inactive relationship for the current measure.

 

If you need additional help, you'll need to post some sample data in text format. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.