Forum Discussion
Replace value based on slicer
- Anonymous4 years ago
Hi Anonymous ,
Here's my solution.
1.Add an index column into your table visual. If there is no index column, it is likely to affect the rendering of the data. For example, the same percentage may only appear once.
You can directly add an index column in Power Query, or add an index column by group. Reference: Create Row Number for Each Group in Power BI using Power Query - RADACAD
2.There's no relationship among tables.
3.Create a measure to return the different results.
Measure = SWITCH ( SELECTEDVALUE ( 'Slicer2'[Show/Hide Name] ), "Hide", IF ( SELECTEDVALUE ( Slicer[Hauliers] ) = MAX ( 'Table'[Hauliers] ), MAX ( 'Table'[Hauliers] ), "Haulier" ), "Show", MAX ( 'Table'[Hauliers] ) )Here is the output:
When 'Hide' and 'C' are selected,
When 'Show' and 'C' are selected,
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Here's my solution.
1.Add an index column into your table visual. If there is no index column, it is likely to affect the rendering of the data. For example, the same percentage may only appear once.
You can directly add an index column in Power Query, or add an index column by group. Reference: Create Row Number for Each Group in Power BI using Power Query - RADACAD
2.There's no relationship among tables.
3.Create a measure to return the different results.
Measure =
SWITCH (
SELECTEDVALUE ( 'Slicer2'[Show/Hide Name] ),
"Hide",
IF (
SELECTEDVALUE ( Slicer[Hauliers] ) = MAX ( 'Table'[Hauliers] ),
MAX ( 'Table'[Hauliers] ),
"Haulier"
),
"Show", MAX ( 'Table'[Hauliers] )
)
Here is the output:
When 'Hide' and 'C' are selected,
When 'Show' and 'C' are selected,
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous Thank you a lot. It worked for me.