Forum Discussion
Conditional formatting in table not showing for row where one column has no value
I applied conditional formatting to a table I'm using to pull in project status information. In addition to the project status and title I have columns for key accomplishments, upcoming activities, count of open issues and count of open risks. Not all projects have open issues and risks. When I remove the open issues and risks count columns, my first column (Project status) renders correctly, with all projects with an 'On Track' status showing green. When I add in the Count of open issues column I have to choose 'Show items with no data' and then my last row (which doesn't have any issues) shows up, but it stops rendering green. Is this a bug since the conditional formatting is based on a field that DOES have information in it?
7 Replies
- Ritaf1983
Super User
Hi Anonymous
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
- AnonymousNot applicable
See additional information in reply below but here's some sample data from the two tables involved:
- AnonymousNot applicable
My org doesn't allow me to share data externally via onedrive and I don't have the option to upload a pbix. I created two super simple data dables (see below). I added this data to my powerbi and created a one to many relationship between project to risks using the Project ID. I then added two tables to my dashboard - one with a count (distinct) of risk ID field, the other without. In the table with a count of risk ID column, I chose to 'show items with no data'. I applied conditional formatting to both tables based on project status.
Project ID Project Name Project Status P1 Project one On track P2 Project two At risk P3 Project three Off track Risk ID Risk Name Associated Project ID 1 Risk one P1 2 Risk two P1 3 Risk three P2
- suparnababu8
Super User
Hi Anonymous
You may include IF or ISBLANK in your DAX functions and try. If you need correct answer pls share your sample pbix file here - danextian
Super User
hi Anonymous
Is the conditional formatting based on the word On Track or on another measure? I would try to add that measure to the viz to see what it returned which may not be what you would expect.
- AnonymousNot applicable
Yes, the conditional formatting is based on the Project Status field. (On Track, At Risk, Off Track, On Hold)
In the example above, the only thing that's different about the line item without the conditional formatting is that it doesn't have any open issues. If I remove the Count of open issues column the row renders correctly. If I leave the count of open issues column in, but don't select 'show items with no data' then this last row doesn't show up. If I select 'show items with no data' the row shows up but the conditional formatting doesn't work for that specific row.
- AnonymousNot applicable
I didn't do any coding; just used out of the box functionality.
Here's another example, this time using a count of new risks column; same scenario.For New risks, I used a quick measure for a filtered value (
New Risks =CALCULATE(COUNTA('Project_Risks'[ID]),'Project_Risks'[Status] IN { "New" })The last row doesn't have any risks and the conditional formatting is not rendering.