Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Sorting data for multi row card visual

Hello everyone. I'm having some trouble displaying data on a multi row card. My dataset is an SharePoint document that contains 5 columns, one of which is a calculated by dax. Disclaimer: Sch...
  • Anonymous's avatar
    Anonymous
    4 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 Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.