cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

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.

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...

Output:

Formulae used:

1 ACCEPTED SOLUTION
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

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...

2 REPLIES 2
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

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...

Helper I

Thank you for your efforts!! 🙂

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.