Forum Discussion
Format value based on selection
- 1 year ago
Hi Oros
You should create a names table that is not connected to the transactions table :and then create Dax with crossjoin inside for marker's color :
color =VAR SelectedNames = VALUES(Names[Name])VAR ProductsFromSelectedNames =DISTINCT(FILTER(CROSSJOIN(Names, fruits),'fruits'[Name] IN SelectedNames))VAR CurrentProduct = SELECTEDVALUE(fruits[Product])RETURNIF(CurrentProduct IN SELECTCOLUMNS(ProductsFromSelectedNames, "Product", fruits[Product]),"Yellow",0)Use names table for the slicer:Use a measure that we created for the conditional formatting
Result:
Will work with top n logic in the same way.
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- Anonymous1 year ago
Hi Oros ,
Based on the description, the method Ritaf1983 provided should be helpful
Besides, try using the following DAX formula to filter the top n product.
Product Rank = RANKX(ALL('Table'), [Total number], , DESC, Dense)TopN filter = VAR SelectedTopN = SELECTEDVALUE('Table top n'[TopN]) RETURN IF([Product Rank] <= SelectedTopN, 1, 0)Drag the measure to the Filters pane and set the show item is 1.
Then, drag the sales person to the slicer visual and select the person.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 1 year ago
Hi Anonymous,
Thank you so much for helping. Your solution works as well!
Hi Oros ,
Based on the description, the method Ritaf1983 provided should be helpful
Besides, try using the following DAX formula to filter the top n product.
Product Rank = RANKX(ALL('Table'), [Total number], , DESC, Dense)TopN filter =
VAR SelectedTopN = SELECTEDVALUE('Table top n'[TopN])
RETURN
IF([Product Rank] <= SelectedTopN, 1, 0)
Drag the measure to the Filters pane and set the show item is 1.
Then, drag the sales person to the slicer visual and select the person.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous,
Thank you so much for helping. Your solution works as well!