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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Matrix - Add Column to separate 2 measures

 

Hi, 

 

I am fairly new to Power Bi.

 

Please see below Matrix for both Male and Female and by their different Groups. How do I insert another blank column after the total column? 

 

Table.PNG

 

If this can't be done, would it be possible to have the values for female in Blue and the Male Values in Red? See table  I have produced in excel. 

 

Table2.PNG

 

 

 

Thank you, 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Create a measure using dax like pattern below:

Measure = SWITCH(SUM('Table'[Value]), CALCULATE(SUM('Table'[Value]), FILTER('Table', 'Table'[Gender] = "Male")), "Blue", CALCULATE(SUM('Table'[Value]), FILTER('Table', 'Table'[Gender] = "Female")), "Red")

And then open conditional formatting and select Field Value based on the Measure above:

Capture.PNG  

 

You can also refer to the pbix file.

 

Community Support Team _ Jimmy Tao

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

10 REPLIES 10
Anonymous
Not applicable

Hi I have tried that formula and it does not seem to work. Is there anything else I could try?

 

All the values in the table are caluclated by measures if that helps? 

 

Thank you, 

 

@v-yuta-msft 

@Anonymous 

@Anonymous ,

 

You mean the in the "value field" of the matrix visual is measure, not the aggregation of raw data, right? If so, you need to convert the measure to calculate column to make the solution I post above work.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Anonymous
Not applicable

 

That worked thank you!! Only problem I have now is to show the 0 value in my table, any idea on how this is done? I know in excel you could write a formula IFBLANK. 

 

See snippet below. 

 

Capture.PNG

 

Thank you once again. 

@v-yuta-msft 

@Anonymous 

@Anonymous ,

 

Just add +0 at the end of the calculate column.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi, 

 

My raw data has no blanks but when I create a measure to include everything in my matrix there are some fields which are blank, are you sure +0 will work, I don't think it will as there are no gaps. 

 

Thank you 

@v-yuta-msft 

@Anonymous ,

 

You can use ISBLANK() function in power bi, please refer to:

https://docs.microsoft.com/en-us/dax/isblank-function-dax

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Create a measure using dax like pattern below:

Measure = SWITCH(SUM('Table'[Value]), CALCULATE(SUM('Table'[Value]), FILTER('Table', 'Table'[Gender] = "Male")), "Blue", CALCULATE(SUM('Table'[Value]), FILTER('Table', 'Table'[Gender] = "Female")), "Red")

And then open conditional formatting and select Field Value based on the Measure above:

Capture.PNG  

 

You can also refer to the pbix file.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Just with a quick view and no experiment made I would make a measure if(gender="f",1,0) and would conditional formatting,

 

Let me know if it worked, if not I'll take a Deeper look 😀

 

BR,

DR

Anonymous
Not applicable

Hi,

 

That did not work, it came up with an error message.

 

"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

 

Thank you @Anonymous 

Anonymous
Not applicable

Hello,

Can you show a field selected pane so I can see how's your data is structured?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors