Forum Discussion

firstch's avatar
firstch
Icon for Helper III rankHelper III
4 years ago
Solved

please Help Dax for smart narrative

I really need help for using function concatenatex for the top 3 value for smart narrative  how to solve  this  error smart narrative, i try to show top 3 country by total value but the countr...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, firstch ;

    You could change it such as:

    rank = 
    CONCATENATEX (
        FILTER (
            ALLSELECTED ( 'financials'[Country] ),
            RANKX (
                ALL ( financials ),
                CALCULATE ( [total], ALLEXCEPT ( financials, 'financials'[Country] ) ),
                ,
                DESC,
                DENSE
            ) <= 3
        ),
        'financials'[Country],
        ",",
        [total], DESC
    )

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-yalanwu-msft's avatar
    4 years ago

    Hi, firstch ,

    You could try it.

    rank = 
    CONCATENATEX ( FILTER( ALLSELECTED( 'Table'),[product]=MAX([product])&&
            RANKX (
                FILTER( ALLSELECTED ( 'Table'),[product]=MAX([product])),
                CALCULATE ([Total]),
                ,
                DESC,
                DENSE
        )
       
     <= 3
        ),
       'Table'[country],
        ",",
       [Total], DESC
    )

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.