Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Power BI Community,
I'm relatively new to DAX so my apologies if I miss an obvious solution here, but I tried different options I found in this forum and couldn't make this work.
So let's say I have this data table:
Date | Location | Category | Value |
5/1/21 | Paris | A | 5 |
5/1/21 | Milan | A | 10 |
5/2/21 | Paris | B | 10 |
5/2/21 | Milan | B | 5 |
5/4/21 | Paris | A | 10 |
What I need is a measure for moving SUM of value (let's say last 3 days). I want this measure to skip missing dates (i.e. 5/3/21) and to work when filtering in a pivot table by one or more of my dimensions (e.g. Location). So for example:
Any suggestions?
I tried with time intelligence functions (e.g. DATEINBETWEEN), with TOPN and creating an Index ranking existing dates value but none of these worked as expected. Either it included missing dates or it worked but not when filtering.
I would prefer a measure but can consider other solutions.
Please note that I'm working on PowerPivot not PowerBI, I found in this forum a viable solution for this but it used the SELECTEDVALUE function which is not available in PowerPivot.
Hope I made this clear.
Thanks for your kind help.
Giacomo
Solved! Go to Solution.
Hi, @gimast
Please check the below picture and the sample pbix file's link down below.
I tried to expand the sample a little bit, like below.
All measures are in the sample pbix file, and all steps are numbered in front of each measure.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
Hi, @gimast
Please check the below picture and the sample pbix file's link down below.
I tried to expand the sample a little bit, like below.
All measures are in the sample pbix file, and all steps are numbered in front of each measure.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
This works perfectly! Thank you, @Jihwan_Kim, for your kind help.
I'm marking this as accepted solution.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |