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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Acmanning
New Member

Building Table issue

Having trouble creating measures to format a matrix. I can't get report to subtract to show variance in table format. I.e. Total Budget and Total Actual in value, based upon Quarter.

 

YearQuarterMonthLedger TypeAmount
CY 2025Q1 CY 2025Jan-25Budget                             30,000.00
CY 2025Q1 CY 2025Jan-25Budget                             50,000.00
CY 2025Q1 CY 2025Jan-25Budget                             60,000.00
CY 2025Q1 CY 2025Jan-25Budget                             70,000.00
CY 2025Q1 CY 2025Jan-25Budget                             80,000.00
CY 2025Q1 CY 2025Jan-25SPBudget                             90,000.00
CY 2025Q1 CY 2025Jan-25SPBudget                          100,000.00
CY 2025Q1 CY 2025Jan-25SPBudget                          110,000.00
CY 2025Q1 CY 2025Jan-25SPBudget                          120,000.00
CY 2025Q1 CY 2025Jan-25SPBudget                          130,000.00
CY 2025Q1 CY 2025Jan-25Actual                          140,000.00
CY 2025Q1 CY 2025Jan-25Actual                          150,000.00
CY 2025Q1 CY 2025Jan-25Actual                          160,000.00
CY 2025Q1 CY 2025Jan-25Actual                          170,000.00
CY 2025Q1 CY 2025Jan-25Actual                          180,000.00
CY 2025Q1 CY 2025Jan-25SPActual                          190,000.00
CY 2025Q1 CY 2025Jan-25SPActual                          200,000.00
CY 2025Q1 CY 2025Jan-25SPActual                          210,000.00
CY 2025Q1 CY 2025Jan-25SPActual                          220,000.00
CY 2025Q1 CY 2025Jan-25SPActual                          230,000.00
2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@Acmanning 

To create measures in Power BI that will allow you to format a matrix and show the variance between Total Budget and Total Actual based on the Quarter, you can follow these steps:

 

Create Measures for Total Budget and Total Actual:

 

DAX
Total Budget = CALCULATE(SUM('Table'[Amount]), 'Table'[Ledger Type] IN {"Budget", "SPBudget"})


Total Actual = CALCULATE(SUM('Table'[Amount]), 'Table'[Ledger Type] IN {"Actual", "SPActual"})


Create a Measure for Variance:

Next, create a measure to calculate the variance between the total budget and total actual amounts.

Variance = [Total Actual] - [Total Budget]


Format the Matrix:

Add a matrix visual to your report.
Drag the Year and Quarter fields to the Rows area.
Drag the Total Budget, Total Actual, and Variance measures to the Values area.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

Anonymous
Not applicable

Hi, @Acmanning 

 

In your Matrix visual, simply drag the “Quarter” field to the rows area and the “Total Budget”, “Total Actual Total Budget”, ‘Total Actual’ and ‘Variance’ Measure to the value area, like this:

vfenlingmsft_0-1740016661844.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Acmanning
New Member

Thanks. I did those steps, but now my table displays two many columns 

Acmanning_0-1739969468528.png

 

Anonymous
Not applicable

Hi, @Acmanning 

 

In your Matrix visual, simply drag the “Quarter” field to the rows area and the “Total Budget”, “Total Actual Total Budget”, ‘Total Actual’ and ‘Variance’ Measure to the value area, like this:

vfenlingmsft_0-1740016661844.png

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bhanu_gautam
Super User
Super User

@Acmanning 

To create measures in Power BI that will allow you to format a matrix and show the variance between Total Budget and Total Actual based on the Quarter, you can follow these steps:

 

Create Measures for Total Budget and Total Actual:

 

DAX
Total Budget = CALCULATE(SUM('Table'[Amount]), 'Table'[Ledger Type] IN {"Budget", "SPBudget"})


Total Actual = CALCULATE(SUM('Table'[Amount]), 'Table'[Ledger Type] IN {"Actual", "SPActual"})


Create a Measure for Variance:

Next, create a measure to calculate the variance between the total budget and total actual amounts.

Variance = [Total Actual] - [Total Budget]


Format the Matrix:

Add a matrix visual to your report.
Drag the Year and Quarter fields to the Rows area.
Drag the Total Budget, Total Actual, and Variance measures to the Values area.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.