Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

To Sort by FY

Hi, Need your help regarding sorting, I want the months to sort from Apr to Mar (FY). Please help me with the Dax. TIA.
  • V-lianl-msft's avatar
    4 years ago

    Hi Anonymous ,


    Try to create a sort column:

    sort = IF(AND(
    
    
    YEAR('Table'[Date])=YEAR(TODAY())-1 ,MONTH('Table'[Date])>3) ||
    
    AND(
    
    YEAR('Table'[Date])=YEAR(TODAY()) , MONTH('Table'[Date])<4),format(YEAR('Table'[Date])*100+MONTH('Table'[Date]),"000000"),RIGHT('Table'[FY],4))

    Change the format of this column to whole number,then sort FY-Month by this column.


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