Forum Discussion
Sorting data for multi row card visual
- Anonymous4 years ago
Hi Anonymous ,
I think you can try If function and add some filter in your code to achieve your goal.
My Sample:
We can see in my sample 1s with same "Days On Hold" should return "Refresh Data" for the smallest Order .
2s should return "Refresh Data" for the smallest "Days On Hold".
Measure:
Next Activity = VAR _COUNT_SCHEDULE_AFTER_TODAY = CALCULATE ( DISTINCTCOUNT ( 'Table'[Scheduled] ), FILTER ( 'Table', 'Table'[Scheduled] > TODAY () ) ) VAR _ACTIVITY_MAX_ORDER = CALCULATE ( MAX ( 'Table'[Activity] ), 'Table'[Days On Hold] > 0 && 'Table'[Order] = MIN ( 'Table'[Order] ) ) VAR _NEXT_ACTIVITY = CALCULATE ( MIN ( [Activity] ), 'Table'[Days On Hold] > 0 && 'Table'[Days On Hold] = MIN ( 'Table'[Days On Hold] ) ) RETURN IF ( _COUNT_SCHEDULE_AFTER_TODAY = 1, _ACTIVITY_MAX_ORDER, _NEXT_ACTIVITY )Result
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Select the Activity Column in Data Tab and then sort by the order column
Sorry, I didn't mention on the Post.
But I've already sorted Activity Column by Order Column as you suggested.
- mh25874 years agoSuper User
Then try visual option to sort by order column
- Anonymous4 years agoNot applicable
I'm not using Order Column at the visual and I can't seem to find a way that let me Sort the activities without applying Order to the visual. Besides, anytime I try to add said column to the visual it shows all of the Activities instead of only the next one.
- Anonymous4 years agoNot applicable
Hi Anonymous ,
I think you can try If function and add some filter in your code to achieve your goal.
My Sample:
We can see in my sample 1s with same "Days On Hold" should return "Refresh Data" for the smallest Order .
2s should return "Refresh Data" for the smallest "Days On Hold".
Measure:
Next Activity = VAR _COUNT_SCHEDULE_AFTER_TODAY = CALCULATE ( DISTINCTCOUNT ( 'Table'[Scheduled] ), FILTER ( 'Table', 'Table'[Scheduled] > TODAY () ) ) VAR _ACTIVITY_MAX_ORDER = CALCULATE ( MAX ( 'Table'[Activity] ), 'Table'[Days On Hold] > 0 && 'Table'[Order] = MIN ( 'Table'[Order] ) ) VAR _NEXT_ACTIVITY = CALCULATE ( MIN ( [Activity] ), 'Table'[Days On Hold] > 0 && 'Table'[Days On Hold] = MIN ( 'Table'[Days On Hold] ) ) RETURN IF ( _COUNT_SCHEDULE_AFTER_TODAY = 1, _ACTIVITY_MAX_ORDER, _NEXT_ACTIVITY )Result
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.