Forum Discussion
Measure Running Sum Up To A Point
Hi,
I have two tables:
1. List of development months (1 to 42)
2. List of transactions
There is a one to many relationship between tables 1 & 2.
I want to create a cumulative running total over development months like the example below.
However, I want the calulation to stop at certain points and preferably show null.
So for the 2017 column stop at month 30 / 2018 column stop at month 18 / 2019 column stop at month 6.
The red blocks I want to show NULL
The current measure is:
Any assistance will be great!
Thanks
Jason
Hi Anonymous ,
I create a sample using the function of switch you can have a try.
Measure = CALCULATE ( SUM ( Triangles_Merged[Gross Gross Premiums] ), FILTER ( ALLSELECTED ( Triangles_Merged ), Triangles_Merged[DevelopmentMonth] <= MAX ( 'Development Months'[DevelopmentMonth] ) ),VALUES(Triangles_Merged[year]) )
Measure 2 = SWITCH ( TRUE (), MAX( Triangles_Merged[year] ) = 2017, CALCULATE ( 'Development Months'[Measure], FILTER ( 'Development Months', 'Development Months'[DevelopmentMonth] <= 30 ) ), MAX( Triangles_Merged[year] ) = 2018, CALCULATE ( 'Development Months'[Measure], FILTER ( 'Development Months', 'Development Months'[DevelopmentMonth] <= 18 ) ), MAX( Triangles_Merged[year] ) = 2019, CALCULATE ( 'Development Months'[Measure], FILTER ( 'Development Months', 'Development Months'[DevelopmentMonth] <= 6 ) ), BLANK () )
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-xuding-msftCommunity Support
Hi Anonymous ,
I create a sample using the function of switch you can have a try.
Measure = CALCULATE ( SUM ( Triangles_Merged[Gross Gross Premiums] ), FILTER ( ALLSELECTED ( Triangles_Merged ), Triangles_Merged[DevelopmentMonth] <= MAX ( 'Development Months'[DevelopmentMonth] ) ),VALUES(Triangles_Merged[year]) )
Measure 2 = SWITCH ( TRUE (), MAX( Triangles_Merged[year] ) = 2017, CALCULATE ( 'Development Months'[Measure], FILTER ( 'Development Months', 'Development Months'[DevelopmentMonth] <= 30 ) ), MAX( Triangles_Merged[year] ) = 2018, CALCULATE ( 'Development Months'[Measure], FILTER ( 'Development Months', 'Development Months'[DevelopmentMonth] <= 18 ) ), MAX( Triangles_Merged[year] ) = 2019, CALCULATE ( 'Development Months'[Measure], FILTER ( 'Development Months', 'Development Months'[DevelopmentMonth] <= 6 ) ), BLANK () )
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.