Forum Discussion
Trend Sorting
- 1 year ago
Create Measures: Ensure that your measure for trend sorting is dynamic and responds to slicer selections. You can use DAX functions like SELECTEDVALUE or ALLSELECTED to capture the slicer values.
Sort Logic: Implement the sorting logic within your measure. For example, you can use SWITCH or IF statements to determine the sorting order based on the trend direction (down arrow first, up arrow last).
Apply Sorting: Use the measure to sort your visual. In Power BI, you can set the sort order of a visual based on a measure.
DAX
TrendSortMeasure =
VAR SelectedSlicer1 = SELECTEDVALUE(SlicerTable1[Column1])
VAR SelectedSlicer2 = SELECTEDVALUE(SlicerTable2[Column2])
-- Add more slicer variables as needed
VAR TrendDirection = IF([TrendMeasure] < 0, 1, 2) -- 1 for down arrow, 2 for up arrow
RETURN
TrendDirection +
IF(SelectedSlicer1 = "Value1", 0,
IF(SelectedSlicer1 = "Value2", 10, 20)) +
IF(SelectedSlicer2 = "ValueA", 0,
IF(SelectedSlicer2 = "ValueB", 5, 10))
-- Add more conditions for other slicers
Hi ManishaDeval_05 ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution we provided for your issue worked for you or let us know if you need any further assistance?
Your feedback is important to us, Looking forward to your response.