Forum Discussion
Moving SUM excluding missing dates in PowerPivot
- 5 years ago
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.
1 Values Total =SUM(data[Value])2 Dates Rank without Blank =VAR _tablewithvalues =FILTER (SUMMARIZE (ALLSELECTED ( 'calendar' ),'calendar'[Date],"@value", [1 Values Total]),[@value] > 0)RETURNIF( ISFILTERED('calendar'[Date]),IF (NOT ISBLANK ( [1 Values Total] ),RANKX ( _tablewithvalues, CALCULATE ( MAX ( 'calendar'[Date] ) ),, ASC )))3 Values Total Latest 3 dates =VAR _currentrank = [2 Dates Rank without Blank]VAR _dateswithrank =FILTER (SUMMARIZE (ALLSELECTED ( 'calendar' ),'calendar'[Date],"@value", [1 Values Total],"@rank", [2 Dates Rank without Blank]),[@rank] >= _currentrank - 2&& [@rank] <= _currentrank)RETURNIF ( ISFILTERED ( 'calendar'[Date] ), SUMX ( _dateswithrank, [@value] ) )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
- gimast5 years ago
Microsoft Employee
This works perfectly! Thank you, Jihwan_Kim, for your kind help.
I'm marking this as accepted solution.