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

View all the Fabric Data Days sessions on demand. View schedule

Reply
TusharGaurav
Helper III
Helper III

How to create calculation(DAX) in case there are two different date range slicers

Hi Experts,

There is a table containing coulmns like Date and Revenue.

Now I need to create two differnet date Slicers from the "Date" column as below:

Slicer1:Current Date Range

Slicer2:Previous Date Range

Based on the Dates selected in the date Slicer, I should have 2 different calculations for Revenue as below:

Current Revenue:to show the revenue based on date seleted in "Slicer1"

Previous Revenue:to show the revenue based on date seleted in "Slicer2"

Please refer the example as below:

Suppose there is a table visualization having columns"Current Reveune"and "Previous Revenue".

Suppose, I selected 1-7 Jan2024 in Slicer 1 and 24-28 Dec2023 in Slicer2 then "Current Revenue" column in table visualization above will show the revenue from 1-7Jan2024 and "Previous Revenue" column will show the revenue from 24-28Dec2023.

Is such scenario achievable in power bi.

Please help.

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @TusharGaurav 

I suggest following the method shown here on DAX Patterns:

https://www.daxpatterns.com/comparing-different-time-periods/

 

This method involves creating a copy of your 'Date' table, called 'Comparison Date' in the article, which has an inactive relationship with 'Date'. Then "comparison" measures can be created that activate this relationship and remove filters on the original 'Date' table.

 

The DAX Patterns article also covers adjusting the comparison measures to correct for different numbers of dates, but you may not need to do that.

 

Please post back if needed 🙂

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @TusharGaurav 

I suggest following the method shown here on DAX Patterns:

https://www.daxpatterns.com/comparing-different-time-periods/

 

This method involves creating a copy of your 'Date' table, called 'Comparison Date' in the article, which has an inactive relationship with 'Date'. Then "comparison" measures can be created that activate this relationship and remove filters on the original 'Date' table.

 

The DAX Patterns article also covers adjusting the comparison measures to correct for different numbers of dates, but you may not need to do that.

 

Please post back if needed 🙂

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Thanks a lot for your help Owen. I was looking for the same. 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors