cancel
Showing results for 
Search instead for 
Did you mean: 
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
Super User
Super User

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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors