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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Month and week hierarchy issue

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @v-yiruan-msft,

Thanks for the response. I have solved this issue. For this I have created a week number calculated column and month no calculated column. I have mapped month = selectedvalue(month no) && week number=selectedvalue(week number) by using this condition I have got the coresponding month for selected week and selected year. Below is the measure which I have created for week&month hierarchy.

 

 SLA <45 Week% =
Var Sel_yr =  'Sheet'[Selected Year]
Var Sel_Month=selectedvalue('Sheet'[Date].[MonthNo])
Var Sel_Wk = SELECTEDVALUE('Sheet'[Week Number])
Var __Daily='SLA Calculations'[SLA <45]/24
var __weekly = __Daily/7
Return
CALCULATE(__Weekly,'Sheet'[Date].[Year]=Sel_yr,'Sheet'[Date].[Monthno]=Sel_Month, 'Sheet'[Week Number] =Sel_Wk)
 
Best Regards,
SW

View solution in original post

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

Is the month slicer referencing the Month field from the Date Hierarchy? If so, please try to create a new calculated column as follows to get the Month, and then use this calculated column to replace the Month field in the previous Date Hierarchy. Later, check if only the corresponding month be displayed when specific year and week be selected. Please find the details in the attachment.

yingyinr_0-1647337163188.png

Month = FORMAT('2020 Master Sheet'[Date],"MMMM")

yingyinr_1-1647337614649.png

Best Regards

Community Support Team _ Rena
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-yiruan-msft,

Thanks for the response. I have solved this issue. For this I have created a week number calculated column and month no calculated column. I have mapped month = selectedvalue(month no) && week number=selectedvalue(week number) by using this condition I have got the coresponding month for selected week and selected year. Below is the measure which I have created for week&month hierarchy.

 

 SLA <45 Week% =
Var Sel_yr =  'Sheet'[Selected Year]
Var Sel_Month=selectedvalue('Sheet'[Date].[MonthNo])
Var Sel_Wk = SELECTEDVALUE('Sheet'[Week Number])
Var __Daily='SLA Calculations'[SLA <45]/24
var __weekly = __Daily/7
Return
CALCULATE(__Weekly,'Sheet'[Date].[Year]=Sel_yr,'Sheet'[Date].[Monthno]=Sel_Month, 'Sheet'[Week Number] =Sel_Wk)
 
Best Regards,
SW

Hi @Anonymous ,

It's glad to hear that your issue has been resolved. And thanks for sharing your solution here. Could you please mark your post as Answered? It will help the others in the community find the solution easily if they face the same issue as yours. Thank you.

Best Regards

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

@Anonymous , not very clear, if year , week and month coming from same table, then they should filter the slicer

Anonymous
Not applicable

Hi @amitchandak,

Thanks for the response. Yes, Year, Month and week coming from same table but it's not working.  If I select year and week number then the data is changing and getting expected results but If I select Year, Month and week number then I am not getting exepected result. So, basically Month is not getting filtered here and I didn't understand the reason.

 

Best Regards,
SW

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.