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
powerbiasker
Helper IV
Helper IV

Help: Conditional Formatting can't work if remove [year] for a Matrix visual

I drag and drop a Matrix into the Page, put [year] from a date table to Rows, and put the following 2 measures to Values.

cntd_dif_ti_CF = [cntd_ti_CY_way2] - [cntd_ti_LY_way2_2]

cntd_ti_indicator = SWITCH(
TRUE(),
[cntd_ti_CY_way2] <= 0, "NA",
[cntd_ti_CY_way2] > [cntd_ti_LY_way2_2],UNICHAR(9650),
[cntd_ti_CY_way2] < [cntd_ti_LY_way2_2],UNICHAR(9660),
                [cntd_ti_CY_way2] = [cntd_ti_LY_way2_2],UNICHAR(9679),
BLANK()
)

 

Then, use the following measure as 'Field value' for conditionally formatting the font color of [cntd_ti_indicator] :

cntd_ind_color = SWITCH(
TRUE(),
[cntd_dif_ti_CF] > 0, "Green",
[cntd_dif_ti_CF] < 0, "Red",
[cntd_dif_ti_CF] = 0, "Blue",
BLANK()
)

 

Now, get:

dif1.PNG

 

However, if I remove/exclude [year] from Rows (of the Matrix), the conditional formatting can't work, e.g.

dif2.PNG

 

I just need a single row with green arrow-up for increase or red arrow-down for decrease; I don't want multiple rows (as the top picture). How should I do?

 

1 ACCEPTED SOLUTION

Hi @powerbiasker 

 

I just replicated your data, your issue is cozed when you remove the rows of matrix that leave only values in matrix, which make it not complete.

I'd suggest you move the column cntd_dif_ti_CF to Rows field:

0007.PNG

 

Community Support Team _ Dina Ye
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

6 REPLIES 6
v-diye-msft
Community Support
Community Support

Hi @powerbiasker 

 

Could you please kindly share your pbix file that I can check it further? please make sure you've removed the confidential info before sharing. 

You can upload it to Onedrive/dropbox and share the link here.

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

I can't use Onedrive/dropbox…

 

I simplify the example/problem as follows

1) Have the dataset like

1.PNG

 

2) Create 3 matrixes for investigation

2.PNG

  • The right top matrix has [year] in Rows.
  • The right bottom matrix doesn't have [year] in Rows.
  • Both the right top/bottom matrixes have conditional formatting on [cntd_ti_indicator] using [cntd_ind_color] for 'Font color' (formatted by 'Field value').

 

3) Click a [year] value on the left matrix; no color change for the right bottom matrix, e.g. clicking 2015...

3.PNG

 

Question:

I need a single row like the right bottom matrix and also need the color of indicators (arrows) to change according to [cntd_dif_ti_CF] (i.e. if the value of [cntd_dif_ti_CF]  is positive, then green; if it's negative, then red). How should I do? Is this a bug for Power BI?

 

Hi @powerbiasker 

 

I just replicated your data, your issue is cozed when you remove the rows of matrix that leave only values in matrix, which make it not complete.

I'd suggest you move the column cntd_dif_ti_CF to Rows field:

0007.PNG

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Thank you!

 

Is that possible when I click 'Total' on the left side Matrix, the new Matrix can only show 1 single row (as follows)?

4.PNG

 

 

Hi @powerbiasker 

 

It's not able to achieve this coz the Total was generated by the Matrix visual itself, not the actual row/column. 

Would you mind marking the above post as a solution that helps others find it more quickly? thanks a lot!

 

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

OK, thanks.

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.