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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
emmalim
Frequent Visitor

Matrix computed row - to show computed columns with several measures

Hi @PaulDBrown , thanks for sharing the solution. I'm currently working on a dashboard for P&L statement, I found this sample file works very well for my scenario. However, my dashboard is required to show various columns with different calculation scenario.

Please allow me to use the sample power bi file to show the challenges I faced, I notice when I add additional calculation (for example add/minus 2 measures) to the column measure, the matrix will have error by having this message '  MdxScript(Model) (31,29) Calculation error in meassure '_measure' [Actual]: Cannot convert value 17.86% of type text to type numeric/date.

emmalim_0-1691932452864.png

 

Appreciate if anyone can help to point out the root cause and how to resolve, thank you!

Original post: Solved: Calculate field in row header - Microsoft Fabric Community

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @emmalim ,

 

Currently the measure is of text type, you need to convert it to a numeric type.

Please check the pbix file.

vcgaomsft_0-1692065018084.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

Anonymous
Not applicable

Hi @emmalim ,

 

Please new a measure:

_Actual2 - _Plan2 = [_Actual 2]-[_Plan 2] 

vcgaomsft_0-1692779138298.png

output:

vcgaomsft_1-1692779161199.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

7 REPLIES 7
emmalim
Frequent Visitor

@Anonymous Thanks! It is working well!

Anonymous
Not applicable

Hi @emmalim ,

 

Currently the measure is of text type, you need to convert it to a numeric type.

Please check the pbix file.

vcgaomsft_0-1692065018084.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

@Anonymous Thanks for your kind advice! This method works for my dashboard. Would like to check is it a must to create new measure series [_Actual 2] and [_Plan 2]?
Besides, noticed column  [_Actual 2] and [_Plan 2] did not show in % for the 3 rows, appreciate your support to share how to set the format.  

Anonymous
Not applicable

Hi @emmalim ,

I'm guessing you're using [_Actual] to perform calculations with other values. In your model, it is partially returned by the Format() function, which returns a single string value. String cannot be directly computed with numeric type values. So we need a measure that returns a numeric type result, which is why I created [_Actual 2].


For the second question, please refer to this measure, which formats the results of the measure based on the values of the Structure column.

Actual - Plan = 
SWITCH(
    SELECTEDVALUE('P&L Rows'[Structure]),
    "% SVM", FORMAT([_Actual 2]-[_Plan 2],"Percent"),
    "% Op. Margin", FORMAT([_Actual 2]-[_Plan 2],"Percent"),
    "% EBT", FORMAT([_Actual 2]-[_Plan 2],"Percent"),
    FORMAT([_Actual 2]-[_Plan 2],"##0")
)

vcgaomsft_0-1692148983917.png

FORMAT – DAX Guide

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

@Anonymous  Thanks for the support and explaination!
I encounter another issue whereby when I want to set the font colour based on value:
<0, show as red
>0, show as green
But the condition setting determine the column 'Actual - Plan' as Text:

emmalim_0-1692443106885.png

I will need to set as below:

emmalim_1-1692443155824.png

 

Appreciate your kind support to share the solution, thank you very much!

 

@Anonymous  Attached the BI file for your reference

BI file:

P&L Sample 

 

 

Anonymous
Not applicable

Hi @emmalim ,

 

Please new a measure:

_Actual2 - _Plan2 = [_Actual 2]-[_Plan 2] 

vcgaomsft_0-1692779138298.png

output:

vcgaomsft_1-1692779161199.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.