Forum Discussion
Diff between selected and previous period by week
Hi Experts,
I have [Date] column with only start of the week dates in it. I need to calculate the diff between selected and previous period. There are filters by market, age, gender, brand ect. I added one slicer by period type and one with corresponding dates. The following measure is not showing the latest period and I don't know how to fixed it
Actually if there is better solution I will love to hear it.
Hi HOrakova
Use ALL instead of ALLSELECTED. When filtering the data, only the filtered values are considered unless the previous wave is also included in the filter.
Please note that since ALL is applied to the whole DATA table, the measure will return the value for that specific week selected for the whole of the table.
9 Replies
- danextian
Super User
Hi HOrakova
Use ALL instead of ALLSELECTED. When filtering the data, only the filtered values are considered unless the previous wave is also included in the filter.
Please note that since ALL is applied to the whole DATA table, the measure will return the value for that specific week selected for the whole of the table.
- danextian
Super User
Can you please post a sanitized copy of your pbix? There may be peculiarities in your model that we are not aware of. Please also see the attached sample pbix.
- lbendlin
Super User
Use OFFSET(-1) to get the previous period filter context.
Last Period = CALCULATE( [Switch KPIs], OFFSET(-1,ALLSELECTED(DATA[Wave])) )- HOrakova
Helper I
Unfortunately it is not showing any results.
- v-achippa
Community Support
Hi HOrakova,
Thank you for reaching out to Microsoft Fabric Community.
Try this below measure, this function will work.
previosperiod = CALCULATE([SUMOFVALUES],FILTER(ALL(TEST),TEST[PERIOD]=MAX(TEST[PERIOD])-7))
Let us know if you need any further assistance.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
- v-achippa
Community Support
Hi HOrakova,
Could you please share any sample data or pbix file. So that it will help us to narrow down the issue and provide you the best solution possible. Do not include sensitive information and do not include anything that is unrelated to the issue or question.
Thanks and regards,
Anjan Kumar Chippa