Forum Discussion
How to Dynamically get 13 weeks (FY Week) based on Year selection in Slicer ?
- Anonymous2 years ago
Anonymous
Hello, you can calculate this by directly creating a measure:M_result = VAR FirstDayMAT= MIN('DateTable'[Date]) VAR EndDayMAT= FirstDayMAT+(7*13-1) // Date values from the beginning of the selected year (1/1) to the thirteenth week RETURN CALCULATE(MAX('DateTable'[FY Week]),FILTER(ALLSELECTED(DateTable),'DateTable'[Date]>=FirstDayMAT&& 'DateTable'[Date]<=EndDayMAT))like this:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,Anonymous ,
I am gald to help you.
According to your description, you want data for the first 13 weeks of the selected year.
If you need to filter using a custom column you created yourself, FY Week.
You can refer to the method below:
Here I have also defined a column to simulate your data.
FY Week =
"FY"&'DateTable'[YearNum]&"-W"&'DateTable'[WeekStart]
I got the year and the serial number of week.
WeekNum = VALUE( RIGHT([FY Week],2))
Here you choose to filter the data based on the newly created weekNum, filtering out the selected months with values less than or equal to 13
Then the YearNum is used as a slicer
Like this:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Thanks for your response . I have already tried a similar solution you proposed here. However, We cannot make use of filter pane here. Reason being, I want first 13 weeks based on the Year that is selected in Slicer . So Whole data in visual is now controlled through the slicer.
Hope I made it clear.
Thanks,
GA
- Anonymous2 years agoNot applicable
Anonymous
Hello, you can calculate this by directly creating a measure:M_result = VAR FirstDayMAT= MIN('DateTable'[Date]) VAR EndDayMAT= FirstDayMAT+(7*13-1) // Date values from the beginning of the selected year (1/1) to the thirteenth week RETURN CALCULATE(MAX('DateTable'[FY Week]),FILTER(ALLSELECTED(DateTable),'DateTable'[Date]>=FirstDayMAT&& 'DateTable'[Date]<=EndDayMAT))like this:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.