Forum Discussion
Formatting rows unique to only one table visual
- Anonymous1 year ago
Hi, Anonymous
You can try the following methods.
Measure = VAR _table1=CALCULATETABLE(VALUES(Table1[Commodity number]),FILTER(ALL(Table1),[BM number]=MAX(Table1[BM number]))) VAR _table2=CALCULATETABLE(VALUES(Table2[Commodity number]),FILTER(ALL(Table2),[BM number]=MAX(Table2[BM number]))) VAR _table3=CALCULATETABLE(VALUES(Table3[Commodity number]),FILTER(ALL(Table3),[BM number]=MAX(Table3[BM number]))) RETURN SWITCH(TRUE(), SELECTEDVALUE(Table1[Commodity number]) in EXCEPT(_table1,UNION(_table2,_table3)),1, SELECTEDVALUE(Table2[Commodity number]) in EXCEPT(_table2,UNION(_table1,_table3)),1, SELECTEDVALUE(Table3[Commodity number]) in EXCEPT(_table3,UNION(_table1,_table2)),1,0)Color measure = IF([Measure],"Yellow",BLANK())Then add conditional formatting to each field.
Is this the result you expected?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Yes that is correct! I would like to highlight the rows that only appear for BM number A, but do not appear in BM number B or C, and my plan to do so was to compare the Commodity number column between the three tables to find Commodity numbers unique to each table.
Apologies for sending the data as an image! I hope this table form works 🙂
| BM number | Commodity number | Ingredients | Weight (kg) |
| A1234 | 1 | Water | 9.5 |
| A1234 | 2 | Flour | 5.0 |
| A1234 | 3 | Eggs | 5.3 |
| A1234 | 4 | Milk | 15.0 |
| A1234 | 5 | Sugar | 19.3 |
| A1234 | 9 | Cocoa | 13.2 |
| A1234 | 10 | Cream | 8.5 |
| B5678 | 1 | Water | 19.3 |
| B5678 | 2 | Flour | 1.4 |
| B5678 | 3 | Eggs | 3.4 |
| B5678 | 4 | Milk | 8.4 |
| B5678 | 5 | Sugar | 11.0 |
| B5678 | 6 | Vanilla | 8.1 |
| B5678 | 7 | Almonds | 2.9 |
| B5678 | 8 | Pistachio | 10.3 |
| B5678 | 11 | Almond milk | 14.4 |
| B5678 | 12 | Mint | 5.9 |
| C1122 | 1 | Water | 10.2 |
| C1122 | 2 | Flour | 8.0 |
| C1122 | 3 | Eggs | 11.4 |
| C1122 | 4 | m | 14.5 |
| C1122 | 5 | Sugar | 18.3 |
| C1122 | 6 | Vanilla | 18.9 |
| C1122 | 14 | Matcha powder | 5.5 |
| C1122 | 15 | Vanilla powder | 16.9 |
| C1122 | 16 | 80% dark chocolate | 14.4 |
Hello Anonymous
Below is the DAX code for your solution.
Highlight Measure =
VAR _NonSelectionTable =
CALCULATETABLE(
VALUES( 'Table'[Commodity number] ),
EXCEPT(
ALL('Table'[BM number] ), VALUES( 'Table'[BM number] ) )
)
VAR _ForDebug1 =
CONCATENATEX(
_NonSelectionTable,[Commodity number],","
)
VAR _SelectedTable =
CALCULATETABLE(
VALUES( 'Table'[Commodity number] ),
VALUES('Table'[BM number] )
)
VAR _ForDebug2 =
CONCATENATEX(
_SelectedTable,[Commodity number],","
)
VAR _CompariosnTable =
EXCEPT(
_SelectedTable,_NonSelectionTable
)
VAR _ForDebug3 =
CONCATENATEX(
_CompariosnTable,[Commodity number],","
)
VAR _Result =
IF(
MAX( 'Table'[Commodity number] ) IN _CompariosnTable,"Yellow"
)
RETURN
_ResultBelow is the screenshot
Hope it will help
Regards
sanalytics
If it is your solution then please like and accept it as solution
- Anonymous1 year agoNot applicable
Hello sanalytics,
Thank you so much for your help!
I was able to get it to work on my sample file, but unfortunately it did not work for my actual data. I added the measure to my three table visuals, and it only highlights some unique ingredients but not all of them. The other two tables are all unhighlighted, and depending on the BM number I select, all three tables be all unhighlighted.
My actual data has more columns, but the columns it uses for the table visuals is the same as the sample file, would this make a difference?I am also unable to unselect the stop interactions button for my visuals across all of these pbix files:
The button in the top right cannot be clicked again to unselect it, and I noticed my table visuals have different interactions than the sample file. Could this be affecting it as well?
Thanks again!