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

DAX for comparison of weekly sales vs benchmark

Hi all,

 

Im trying to write a DAX to calculate % difference with benchmark value. The tricky is I will have weekly data added in, so I want to show the % difference per week basis.

 

Below input:

milkynight_0-1632987015171.png

Disired result:

milkynight_1-1632987049649.png

 

Thank you!

 

1 REPLY 1
jppv20
Solution Sage
Solution Sage

Hi @milkynight ,

 

The way to do this is to go to PowerQuery. Select the column with (A, B, C) and choose unpivot other columns. Result:

jppv20_0-1632987888327.png

 

Then you can create a measure like this:

Week vs BM = DIVIDE(SUM(Sales[Value])-SUM(Benchmark[BM]),SUM(Benchmark[BM]),BLANK())
 
Then put it in a Matrix to get this result:
jppv20_0-1632988761629.png

 

 

Jori

 

If I answered your question, please mark it as a solution to help other members find it more quickly.

 
 

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