Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Modelling data upto 3rd level based on Month

Hi, Another major Challenge, I have a requirement to calculate the YTD for certain business unit which has 2 below sub section and I need to select YTD for the BU and its sub section. For example ...
  • v-qiuyu-msft's avatar
    8 years ago

    Hi Anonymous,

     

    You can use Split Column feature in Query Editor to get three columns from Organization Unit:

     

     

    Then create a calculated column to return month number: 

     

    MonthNum = SWITCH(TRUE(),'Table2'[Month]="JAN",1,'Table2'[Month]="FEB",2)

     

    Then create a measure:

    YTD = CALCULATE(SUM(Table2[Count]),FILTER(ALLSELECTED(Table2),'Table2'[MonthNum]<=MAX('Table2'[MonthNum])))

     

     

    Best Regards,
    Qiuyun Yu