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
kalkhudary
Helper III
Helper III

Sum of Gross Values based on the max submission date for each App ID to show in a KPI Card

Hi Experts, 

 

I have daxed the below to be able to get the sum of the gross values where the latest submission date is picked for each application ID and summed with the others. This seems to pick for me only the gross value with the latest date based on all applications. The desire value needs to be 15,214.13 and right now it is showing me 1,982.33

 

I need to have the value in a visual card as a KPI . Not concerned with a slicer or anything. Unfortunately, I am not able to attach the powerBi file but I am attaching a snip of the Page visuals.

 

$Gross Value =
VAR _LatestSubmissionDate = ALLSELECTED('Table'[Submission Date])
 
VAR MaxSubmissionDate= CALCULATE(MAX('Table'[Submission Date]),VALUES('Table'[portalapplicationclaimid]),REMOVEFILTERS('Table'),_LatestSubmissionDate)

VAR ActiveValue =CALCULATE(SUM( 'Table'[totaldisbursement_base]),

FILTER('Table', 'Table'[statuscode] IN {"In Review", "In Review - Manager", "Submitted","Approved", "Opted Out"}), 'Table'[Submission Date]=MaxSubmissionDate)

VAR RESULT = IF(ActiveValue=BLANK(),0,ActiveValue)
RETURN
RESULT
 
How can I adjust this DAX to read properly? Not sure what I am missing or adding to the dax that it is ot reading properly.
 
Snip of the Card.PNG
1 ACCEPTED SOLUTION

Hi, @kalkhudary 

 

You can try the following methods.

Max Date = 
CALCULATE(MAX('Table'[Submission Date]),FILTER(ALLEXCEPT('Table','Table'[ID]),[statuscode] in {"In Review", "In Review - Manager", "Submitted","Approved", "Opted Out"}))
Measure = 
Var _table=SUMMARIZE('Table','Table'[ID],'Table'[statuscode],"Max Date",[Max Date],"Sum",CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[ID]),[Submission Date]=[Max Date])))
Return
SUMX(_table,[Sum])

vzhangti_1-1697617626244.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
kalkhudary
Helper III
Helper III

Thanks so much. That worked perfect!

kalkhudary
Helper III
Helper III

 

The interesting part is that the dax logic is applying to looking at the lastest submission date for the applicationid but when it is summing the gross value, it does sum based on the max submisison date of all the application IDs (9/11/2023). Any thoughts abotu this dilema.

 

Snip of the Card2.PNG

Hi, @kalkhudary 

 

You can try the following methods.

Max Date = 
CALCULATE(MAX('Table'[Submission Date]),FILTER(ALLEXCEPT('Table','Table'[ID]),[statuscode] in {"In Review", "In Review - Manager", "Submitted","Approved", "Opted Out"}))
Measure = 
Var _table=SUMMARIZE('Table','Table'[ID],'Table'[statuscode],"Max Date",[Max Date],"Sum",CALCULATE(SUM('Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[ID]),[Submission Date]=[Max Date])))
Return
SUMX(_table,[Sum])

vzhangti_1-1697617626244.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

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

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors