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

Budget vs Spend measure question

Very new to Dax so to me this is complicated problem made worse by the data structure.  I'm trying to subtract Operating spend from Operating Budget but they are in the same column and need to be compared for the same timeframe so it seems to me that multiple filters will need to be applied for the program to know what value on what row.  I think a measure I can show in the report is sufficient.  Any help is appreciated.  Sample below.  Thanks!

1 REPLY 1
Anonymous
Not applicable

Hi,

 

You would essentially need to use Unpivot Columns under Power Query Editor which would Unpivot the Values under the specified Column, Load the Table and then Calculate the Difference. But Since, You wanted DAX Expression for this, Please use the below mentioned DAX Expression and let me know if the same is working Correctly.

 

Table1:= CALCULATETABLE(Table, Table[Metric_Name]="Operating Budget")

Table2:= ADDCOLUMNS(CALCULATETABLE(Table, Table[Metric_Name]="Operating Spending"),"",CALCULATE(SUM(Table1[Value])-[Value],TREATAS(VALUES(Table[Timeframe_Range]),Table[Timeframe_Range]))

Create Two new Tables with the Following Expression. The Second Table should be the result Table.

 

Best Regards,
Vignesh M

If what I suggested worked for you feel free to Drop a "Kudos" and Consider to "Accept as Solution" if I solved your Issue 🙂

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