Forum Discussion

binayjethwa's avatar
binayjethwa
Helper V
3 years ago
Solved

Edit Sub totals using dax

Hi ,    Basically below is the output that i require to show , which is sales of countries for  current fiscal yeat Month wise.   Region  June'23 July'23 Aug'23 Sep'23 Oct'23 Nov'23 Dec...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi ,  binayjethwa 

    According to your description, you want to add a Sub total as the column in your matrix visual.

    For your needs, you need to recreate a dimension table for the Column field, such as:

    Table  =UNION( VALUES('Table'[Year_month]) , "FY 24")
    Sure , you can also add a rank column to sort the column field.

     

    Then we can use this Table's column as the Matrix visual's column field.

    Then we need to create a measure , use MAX('Table'[Column]) to get the value of the current column header, and then use the IF() and  return the corresponding value according to different situations to meet your needs.

     

    Secondly, according to your description, I don't really understand your company's fiscal year policy, and I don't have your test data, it is difficult to write dax according to different screening contexts, (July'23- June 24) refers to July every year To the value of June, if it is currently July'24, that is the value calculation (Aug'23-July'24)?And the July'23 means the 2023/7/1 ; June 24 means the 2024/6/1?

    However, these are all implemented in the measurement value according to your business needs. For commonly used functions, you can consider using EDATE, EOMONTH(), FILTER(), SUMX() to achieve your needs.

     

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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