Forum Discussion
Like4like e calculationgroup
- 1 year ago
Ciao AntonelloLucia,
you can find my calculation group version here
https://drive.google.com/drive/folders/1BuydNLsMePMXUpwrpzlrp8tTW_kHAuPI?usp=sharing
Please use the sheet "Prova Nuova Apertura CG" where you find the two approaches compared (on the left the approach you already know - no calc groups involved, just plain DAX on the single measures -, on the right the new approach with calc group.
You can use now any measure you want on the right (the calc group approach)
Can you confirm to me this works?
Thanks
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi AntonelloLucia,
Thank you for reaching out to the Microsoft Fabric Forum Community.
Create a tiny disconnected "Like4Like" table (Yes/No) and use it as a slicer. then build one base measure that reads the slicer and applies the L4L rule in one place. include only stores that were open at least 12 months before the selected period starts and not closed before it ends (treat blank Closing Date as still open). If the slicer = Yes, use that filtered set. if No, use the inverse. if nothing is selected, show all. Next, reuse this single base measure for everything else wrap it with standard time functions for PY, YTD, YoY and plug it into margin or other KPIs so any future change to L4L logic is done once and flows everywhere. If you have many KPIs with the same time variations, add a Calculation Group (Current, PY, YTD, YoY) in Tabular Editor so you keep just one base measure per KPI and let the group handle the time math dynamically.
Thank you & Regards,
Prasanna Kumar