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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cdawidow2
Frequent Visitor

SUMX with FIRSTNONBLANK Values, incorrect totals

Hi guys,  I created a measure to track historical values of specific opportunities using FIRSTNONBLANK.  This result turns out okay for each individual opportunity but for the totals, which I want to include all opportunities, the values are not summing correctly.  

Below is the measure I use to retrieve my historic values.  

HISTORICAL AMOUNT = VAR X = calculate(MAXX(VALUES('Opportunity History'[SystemModstamp]),'Opportunity History'[SystemModstamp]),USERELATIONSHIP('DATE'[Date],'Opportunity History'[CreatedDate]))
RETURN
CALCULATE(FIRSTNONBLANK('Opportunity History'[Amount],'Opportunity History'[Amount]),'Opportunity History'[SystemModstamp]=X,USERELATIONSHIP('DATE'[Date],'Opportunity History'[CreatedDate]))
 
But I am having trouble with the total value - I think I should use SUMX but even when I do the values do not total correctly. 
 
Any help would be appreciated.   I have also included my schema below. 
 
 
errors.PNG

 

schema.PNG

 

1 REPLY 1
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @cdawidow2 ,

 

Try this meausre:

 

FixedTotal= SUMX(VALUES(Table[OPPORTUNITY]),[HISTORICAL AMOUNT])

 

 

Mark this as a solution, if I answered your question. Kudos are always appreciated.

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors