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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
komaragiri
Frequent Visitor

Need Help with Matrix Visual - Variance calc

Here is my data file

Resource IdResource NameworkdateHoursflagdata source
12345John Doeelectrical1/1/202510Buildingactual
12345John Doeelectrical1/1/202520Buildingplanned
12345John Doeelectrical1/1/202530Roomactual
12345John Doeelectrical1/1/202540Roomplanned

BI Help.jpg

 

I would like to get the report in this format ...using Matrix Visual. Need help with calculating the Variance as shown below.  

1 ACCEPTED SOLUTION
SamsonTruong
Super User
Super User

Hi @komaragiri ,

To achieve this matrix, we will create 3 measures. I've replicated your data in my environment.

First we will create a measure for Planned using the following DAX:

Planned = 
CALCULATE(
    SUM(TestData[Hours]),
    TestData[data source] = "planned"
)


Then we will create a measure for Actual using the following DAX: 

Actual = 
CALCULATE(
    SUM(TestData[Hours]),
    TestData[data source] = "actual"
)


Finally we will create a third measure that calculates the variance between them using the following DAX:

Variance = 
[Planned] - [Actual]



Once the meaures are created, we can leverage them in a Matrix like so:

SamsonTruong_0-1748571177622.png

 

If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

Thanks,

Samson

View solution in original post

3 REPLIES 3
komaragiri
Frequent Visitor

@SamsonTruong  Thanks for your suggestion. Worked. Kudos to you for helping

@komaragiri Happy to hear the solution worked!

SamsonTruong
Super User
Super User

Hi @komaragiri ,

To achieve this matrix, we will create 3 measures. I've replicated your data in my environment.

First we will create a measure for Planned using the following DAX:

Planned = 
CALCULATE(
    SUM(TestData[Hours]),
    TestData[data source] = "planned"
)


Then we will create a measure for Actual using the following DAX: 

Actual = 
CALCULATE(
    SUM(TestData[Hours]),
    TestData[data source] = "actual"
)


Finally we will create a third measure that calculates the variance between them using the following DAX:

Variance = 
[Planned] - [Actual]



Once the meaures are created, we can leverage them in a Matrix like so:

SamsonTruong_0-1748571177622.png

 

If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

Thanks,

Samson

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.