Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      See additional information in reply below but here's some sample data from the two tables involved:

    • Anonymous's avatar
      Anonymous
      Not 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 IDProject NameProject Status
      P1Project oneOn track
      P2Project twoAt risk
      P3Project threeOff track

       

      Risk IDRisk NameAssociated Project ID
      1Risk oneP1
      2Risk twoP1
      3Risk threeP2

       

  • 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

  • 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.

  • Anonymous's avatar
    Anonymous
    Not 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.

  • Anonymous's avatar
    Anonymous
    Not 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.