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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Nagesh20
Helper I
Helper I

Seperate value from running total measure based on max date

Hi all,

 

I am able to calculat the running total based on max date. I would like to get final number from running total measure based on the max date. I have attached below example (i.e . Total value in table formate). I am looking for new Dax formuala to get this calucation 

Cumulative (running total measure) = 

IF([TotalValue]<>BLANK(),
CALCULATE([TotalValue],
FILTER(ALL(Calender[Date]),Calender[Date]<=MAX(Calender[Date]))))

 

Nagesh20_0-1715003119168.png

 

 

DateProductValueCumulativeTotalvalue
5/2/2024 0:00A100100 
5/3/2024 0:00A50150 
5/4/2024 0:00A30180 
5/5/2024 0:00A26206 
5/6/2024 0:00A30236236
2/28/2023 0:00B5050 
3/1/2023 0:00B3080 
3/2/2023 0:00B26106 
5/6/2024 0:00B100206206
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Nagesh20 ,  Create a measure using your measure

 

if(Max(Calendar[Date]) = maxx(filter(allselected(Table), Table[Product] = max(Table[Product]) ), Table[Date]) , [Cumulative (running total measure) ], blank()) 

 

or

 

 

Measure =
var _max =maxx(filter(allselected(Table), Table[Product] = max(Table[Product]) ), Table[Date])
return
Switch ( true(),
Max(Calendar[Date]) = _max , [Cumulative (running total measure) ],
Max(Calendar[Date]) < _max , 0 ,
blank())

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Nagesh20 ,  Create a measure using your measure

 

if(Max(Calendar[Date]) = maxx(filter(allselected(Table), Table[Product] = max(Table[Product]) ), Table[Date]) , [Cumulative (running total measure) ], blank()) 

 

or

 

 

Measure =
var _max =maxx(filter(allselected(Table), Table[Product] = max(Table[Product]) ), Table[Date])
return
Switch ( true(),
Max(Calendar[Date]) = _max , [Cumulative (running total measure) ],
Max(Calendar[Date]) < _max , 0 ,
blank())

@amitchandak 

Awesome 🙂

2nd formula is working

 

Nagesh20_0-1715007278921.png

Thanks a lot

 

Hi @amitchandak 

 

I am not able to get the total when applying the second formula that you suggested. Could you please advice how to get the total for this formula in the table. 

 

Max =
Var _max=maxx(filter(allselected(Table1), Table1[Product] = max(Table1[Product]) ), Table1[Date])
return
Switch ( true(),
Max(Calender[Date]) = _max ,[Cumulative],
Max(Calender[Date]) < _max , 0 ,
blank())

 

Nagesh20_0-1715159591411.png

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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