Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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 I have this table as Input

Organization Unit          Month     Count    

ABC SSS YYY                   JAN           2

ABC BBB ZZZ                  JAN           3

ABC SSS YYY                   FEB           2

ABC KKK WWW              JAN           2

ABC SSS UUU                 JAN           1

 

So in here ABC is the organization UNIT and SSS, BBB, KKK is the first sub level and YYY,ZZZ,WWW, UUU is the second Sub level.

So when user select ABC in the slicer, he will get the YTD value as 

 

Month  Count   YTD
JAN         8            8

FEB          2           10

 

and when he select ABC in the slicer and in second Slicer he select SSS then he get YTD as below

MONTH  Count    YTD

JAN           3            3

FEB            2            5

 

and when I select in 3rd slicer YYY

 

MONTH COUNT YTD
JAN          2          2

FEB           2          4

 

so this is how it will work, Hope i am clear with my example and would request the experts to join in with me and guide me through this task. The fist level i know can be done but how to do it for 2nd and 3rd level as there will be so many organization unit :?

 hoping for a quick guidance.

Best Regards,
Ankku

 

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

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

 

q1.PNG

 

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])))

 

q2.PNG

 

Best Regards,
Qiuyun Yu

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

View solution in original post

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

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

 

q1.PNG

 

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])))

 

q2.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-qiuyu-msft,

Thanks this work, But I have months for various year, so how to classify that like I get values based on year. Right now with this formulae, It adds the  data for Jan month for 2017 and 2018 both. I need to keep the year wise value seperate and calculate YTD for different year.

Please help me on that.

Thanks,
ankku

Hi @Anonymous,

 

This should be a different requirement from the original post. I would suggest you post a new thread in Desktop forum. Our community support team members will help you. Smiley Happy

 

Best Regards,

Qiuyun Yu 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.