Forum Discussion
Calculating Latest Weeks & Comparing to Same Timeframe PY
Hi v-echaithra ,
A couple of questions...
1. A. Is this dax measure specific, and need to use this dax for all measures in the model?
Reason I ask is because I have many measures and was hoping not to need to create all new ones. I also have multiple data tables rolling into the model.
B. Would this work with as a calculated group using syntax "SelectedMeasure"?
2. If I disconnect my relationship between Lastest Time Period & Fiscal Calendar, is there another way to get the L4, L12, L52, YTD visual below for the end user?
Let me know your thoughts.
Thank you.
Laura
Hi L1102 ,
You do NOT need to recreate all of your business measures.
Your existing measures like [Sales], [Units], [Margin], etc. should remain exactly as they are.
The key is that the logic for L4 / L12 / L52 / YTD and Same Timeframe PY should not live inside each base measure. That logic belongs in a time-filtering layer that wraps those measures.
Yes, the best and most scalable solution is to implement this using a Calculation Group with SELECTEDMEASURE().
This gives you no measure duplication, works automatically across all existing and future measures and works with multiple fact tables.
Keeping Latest Time Periods disconnected is correct and required. The slicer still works because the slicer filters the Latest Time Periods table, TREATAS() explicitly maps those selected dates onto Calendar[Date]. The Calendar table then filters the fact tables through normal relationships which allows you to use one slicer for L4 / L12 / L52 / YTD.
Please provide the sample Pbix file. How to provide sample data in the Power BI Forum
You can refer the following link to upload the file to the community.
How to upload PBI in Community
We are available to support you and are committed to helping you reach a resolution.
Best Regards,
Chaithra E.