Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
sanjaymithran
Helper I
Helper I

Cumulative total based on Sponsor and show Lapse Yr when Cumulative >0

Hi All,

Need help on DAX for the below scenario

1.Need to calculate Cumulative total for Amount based on Lapse Yr and Sponsor

2.BEY-Cumulative total>0 (first postive value) need to show corresponding Lapse Yr for Sponsor,if Cumulative total<0 then 11sanjaymithran_0-1691168488723.png

 

Expected Result:

sanjaymithran_1-1691168569462.png

 

Thanks,

Sanjay

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @sanjaymithran ,

 

If you want to calculate Cumulative total for Amount based on Lapse Yr and Sponsor, try this measure:

 

Cumulative Total = CALCULATE(SUM('Table'[Amount]),FILTER(ALLSELECTED('Table'),[SPONSOR]=MAX('Table'[SPONSOR])&&[LAPSE YR]<=MAX('Table'[LAPSE YR])))

And if you want to calculate the BEY, you can try this measure:

 

BEY = var _BEY=MINX(FILTER(ALLSELECTED('Table'),[SPONSOR]=MAX('Table'[SPONSOR])&&[Cumulative Total]>0),[LAPSE YR])
RETURN IF(_BEY=BLANK(),11,_BEY)

Below is the result.

vstephenmsft_0-1691386136896.png

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @sanjaymithran ,

 

If you want to calculate Cumulative total for Amount based on Lapse Yr and Sponsor, try this measure:

 

Cumulative Total = CALCULATE(SUM('Table'[Amount]),FILTER(ALLSELECTED('Table'),[SPONSOR]=MAX('Table'[SPONSOR])&&[LAPSE YR]<=MAX('Table'[LAPSE YR])))

And if you want to calculate the BEY, you can try this measure:

 

BEY = var _BEY=MINX(FILTER(ALLSELECTED('Table'),[SPONSOR]=MAX('Table'[SPONSOR])&&[Cumulative Total]>0),[LAPSE YR])
RETURN IF(_BEY=BLANK(),11,_BEY)

Below is the result.

vstephenmsft_0-1691386136896.png

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Hi Stephen,

 

Thanks its working ,will check other scenario and comeback if any help needed.

 

Thanks,

Sanjay.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.