Forum Discussion
DAX Measure Formula to Calcualte Running Fleet
- 6 years agoCreate this measure:
TotalGrowth = CALCULATE ( SUM ( 'Table'[Growth] ) )
And then this one:
Cumulative Growth = IF(MIN([Date-Year])<=CALCULATE(MAX([Date-Year]),ALL('Table')),CALCULATE([TotalGrowth],FILTER(All('Table'[Date-Year]),'Table'[Date-Year]<=MAX(('Table'[Date-Year])))),BLANK())
Let me know if that works for you! - 6 years ago
TotalGrowth = CALCULATE ( SUM ( 'Table'[Growth] ) )
And then this one:
Cumulative Growth = IF(MIN([Date-Year])<=CALCULATE(MAX([Date-Year]),ALL('Table')),CALCULATE([TotalGrowth],FILTER(All('Table'[Date-Year]),'Table'[Date-Year]<=MAX(('Table'[Date-Year])))),BLANK())
Let me know if that works for you!
Thank for the reply, the DAX formula which you have is giving the expected result, one thing I want to say the "Registration" , "Termination" & "Growth" are all measure so when I used your formula i am not getting expected as seen in below screen shot,
The Output what I am looking is "Running Fleet" however "Cumulative Growth" is not matching as you can seen below. Please help me 🙏
- Suhel_Ansari6 years ago
Helper V
- joshlwulf6 years ago
Helper I
Hey, Suhel! Sorry I'm still learning a lot of this so I probably won't be able to help much more, but in your calculate function, shouldn't you add a SUMX in there?
- Suhel_Ansari6 years ago
Helper V
No worries, Thank you for all your help, i fingered it out the working formula, i did a little change in the formula and same is seen below. Thanks Josh, with your formula the visuals rendering had been reduced from 21300 mili second to 900 mili seconds ....
Formaul
Running Fleet =
{IF(MIN([Date].[Year]) <=CALCULATE(MAX([Date].[Year]),ALL(Table)),
CALCULATE(([Registrations]-[Terminations]),FILTER(ALL(Table[Date].[Year]),
Table[Date].[Year]<=MAX((Table[Date].[Year])))),BLANK())}Regards
Suhel