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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Shahin
Frequent Visitor

Conditional formatting not working for single row .

Hi Community,

 

Does any body know why the conditional formating not working when you have only one row in your table?  Appricate your responce.

 

Regards,

Shahin

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

Hi,

 

According to your description, I think that any table which doesn't have a grouping displayed as a single row doesn't support conditional formatting.

61.png

Reference:

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#considerations-and-li...

 

And I have a workaround for your problem, so I create a table to test:

62.png

please take following steps:

1)Create a measure to minus [Actual] and Budget:

Measure = SUM('Table'[Actual])-SUM('Table'[Budget])

2)Create a measure to define font format and apply it to above measure:

Format = SWITCH(true,[Measure]>0,"#FF0000",[Measure]<0,"#008000")

63.png

And it shows:

64.png

3)Add a column and change it not summarize:

65.png

When you remove [Department], it shows:

66.png

if you do not want to display the blank column, you can turn off ‘Word wrap’ function in visual format/column headers:

67.png

And it shows:

68.png

Here is my test pbix file:

pbix 

 

Best Regards,

Giotto Zhi

 

View solution in original post

7 REPLIES 7
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I think that any table which doesn't have a grouping displayed as a single row doesn't support conditional formatting.

61.png

Reference:

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#considerations-and-li...

 

And I have a workaround for your problem, so I create a table to test:

62.png

please take following steps:

1)Create a measure to minus [Actual] and Budget:

Measure = SUM('Table'[Actual])-SUM('Table'[Budget])

2)Create a measure to define font format and apply it to above measure:

Format = SWITCH(true,[Measure]>0,"#FF0000",[Measure]<0,"#008000")

63.png

And it shows:

64.png

3)Add a column and change it not summarize:

65.png

When you remove [Department], it shows:

66.png

if you do not want to display the blank column, you can turn off ‘Word wrap’ function in visual format/column headers:

67.png

And it shows:

68.png

Here is my test pbix file:

pbix 

 

Best Regards,

Giotto Zhi

 

Thanks @v-gizhi-msft  so much . it worked. it is even woked with rules.

AiolosZhao
Memorable Member
Memorable Member

Hi @Shahin ,

 

Could you please show your sample data or screenshaot or measure of your report?

 

Because it always works in my report.

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @AiolosZhao 

On the left I have my measure against department which works pefectly fine but as soon as I remove the department from the table (table on the right) the conditional fromating stops working.

 

Thanks 

Conditional.PNG

Hi @Shahin ,

 

Are you using a Field value to do the conditional formatting?

 

If yes, could you please share your Field value measure?

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




 

@AiolosZhao  

 

No, I m using the rules . I tried the Filed Value and got the same result. 

 

SWITCH(TRUE()

,[F A Lab Rev]- [F B Lab Rev] < 0,"#FF0000"
,[F A Lab Rev]- [F B Lab Rev] > 0 ,"#008000"
)

@Shahin ,

 

I assume the [F A Lab Rev] and [F B Lab Rev] are actual and budget, and it works for the first 2 rows.

 

It also doesn't work for the third row, but the "#008000" is green color I think, but it's black in your left table.

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.