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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply

Measure for a Change % KPI, based on two dynamic date ranges

Hey All,

 

The KPI I'm trying to measure is a daily volume avg change between two date ranges

 

Here's the KPI visual:

2020-12-03_11-57-09.jpg

The the Dax formula for the measure displayed in the large % is: 

m_NotifChange (Daily) =
var num = Round((([m_NotifLast30Days (Daily)]-[m_NotifBaseline (Daily)])/[m_NotifBaseline (Daily)])*100,2)
return
if(num>0,"+"&num&"%",num&"%")
 
After sharing this with the business the requirement changed.  They would like the baseline and comparison date ranges to be dynamic.  This would be fine if it were just the bottom 4 visuals, I could edit the interactions between the date range slicers (Below) and those Card visuals:
2020-12-03_11-57-54.jpg
 
However, the measures used in the Main KPI need to be filtered individually by their appropriate slicer.  Is there a way to accomplish this?
 
Thanks
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@HansTheEnforcer , Based on what I got.

 

Refer to my blog , I think very similar Item was disucussed 

https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
v-zhenbw-msft
Community Support
Community Support

Hi @HansTheEnforcer ,

 

Do you want to calculate a date range divided by a date range thirty days ago?

For example, if you select 2020/2/19 – 2020/2/21, then it will calculate the value in 2020/2/19-2020/2/21 divide the value in2020/2/19 minus 30 days – 2020/2/21 minus 30days.

If yes, we can create a date table and a measure to meet your requirement. (Note: date table has no relationship.)

 

Mea1.jpg

 

Measure = 
var _min_date = MIN('Date'[Date])
var _max_date = MAX('Date'[Date])
var _min_date_30 = _min_date-30
var _max_date_30 = _max_date-30
return
DIVIDE( 
    CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[Date]>=_min_date_30 && 'Table'[Date]<=_max_date_30))-
    CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[Date]>=_min_date && 'Table'[Date]<=_max_date)),
    CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[Date]>=_min_date && 'Table'[Date]<=_max_date)))

 

mea2.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

BTW, pbix as attached.

amitchandak
Super User
Super User

@HansTheEnforcer , Based on what I got.

 

Refer to my blog , I think very similar Item was disucussed 

https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This is exactly what I was looking for, thanks!

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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