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
sriramk
Helper I
Helper I

DAX Calculations for representation of percentage change from the previous day

Hello experts!

I am still learning Power Bi and a beginner.

I am trying to track daily performance of all the stores. Please help me in finding the percentage change from the max date to a day before max date for each store.

 

sriramk_0-1669387672408.png

 

Here the "Daily Input" is constant, rarely changes and "Outputs" values varies daily with new dates updated. A sample raw data with calculations and expected outputs are available in the link https://docs.google.com/spreadsheets/d/1Fi5d1TV3sV-4QZzjEggFDChg7n11cgaciVknF76GYwk/edit#gid=7092078... 

 

sriramk_3-1669388405591.png

 

 

Output:

sriramk_4-1669388456410.png

 

 

Formulae used:

sriramk_5-1669388605196.png

 

Thank you for your support and efforts in advance!!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sriramk , better to unpivot the date columns. and then you can this day vs last day using date table and time intelligence

 

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

https://radacad.com/pivot-and-unpivot-with-power-bi

 

This Day = sum('Table'[Qty])

This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Last Day = CALCULATE(sum('Table'[Qty]), previousday('Date'[Date]))

 

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@sriramk , better to unpivot the date columns. and then you can this day vs last day using date table and time intelligence

 

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

https://radacad.com/pivot-and-unpivot-with-power-bi

 

This Day = sum('Table'[Qty])

This Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
Last Day = CALCULATE(sum('Table'[Qty]), previousday('Date'[Date]))

 

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

Thank you for your efforts!! 🙂

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.

Top Solution Authors