Forum Discussion
Problem with Cell Elements Formatting
- 8 months ago
Hi MJG2112 , Thank you for reaching out to the Microsoft Community Forum.
Make sure the table visual includes a unique A key so the measure can evaluate per row. Then add this test measure to the visual, you should see 1 or 0 for each A row:
HasBFlag =
IF( CALCULATE( COUNTROWS( TableB ) ) > 0, 1, 0 )
Apply conditional formatting. Conditional formatting -> Icons (or Background) -> Format style = Rules -> What field should we base this on? = HasBFlag -> Summarization = First. Create two rules: 1 => green icon, 0 => red icon. Don’t return BLANK(), use 0 for missing-B. If A->B filtering is unreliable, use the explicit key variant that matches A’s key to B’s key.
If the test measure still shows the same value for every row, paste the exact DAX you used and a screenshot of the table with the test measure visible and anything you may feel relevant to the issue.
amitchandak Thanks for your swift response. I don't understand what you mean, so I've attached a screen shot to illustrate the problem more clearly. The columns up to Level 3 are from Table A. The Outcome column is from table B. The rows with a blank Outcome have no record in Table B and, as you can see, the cell element formatting has not been applied to columns Level 2 and Level OK.
- amitchandak8 months agoSuper User
MJG2112 , Only rule-based and gradient can handle null, make sure you exclude 0 from the rule. So create a measure that returns a color or a number that you can associate in a rule for color and handle null values. DO not handle 0
Simple example null in red, value in green - amitchandak8 months agoSuper User
MJG2112 , We need a measure like
If( Max(TableB[Outcome]) = blank() , Blank(), TableA[OK])
Now using this measure try to do conditional formatting and see if that can helpIf this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.