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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AndySmith
Helper III
Helper III

SUMX Formula with conditional SUMIF

Hi - I am trying to calculate 'points' for a sales incentive where points are awarded per number of products a customer purchases. 

 

Points = SUMX(VALUES('BrandPrint'[Customer Name]),CALCULATE(IF([New Listings Count]=0,0,IF(AND([New Listings Count]>=1,[Product Count]=4),12,[Product Count]*2))))

 

The totals - which work when calculated against a customner - does not total up correctly in a state summary. See screenshot below. Do i somehow need to incorporat ethe state into the SUMX formula?

 

Thanks

 

Screenshot_4.jpg

4 REPLIES 4
AndySmith
Helper III
Helper III

Thanks for looking into it. Sadly I have tried that already and it doesnt seem to change anything.

 

I have attached a link to a pbix with sample data. You can see that the Customer summary adds up but the state and salesperson tables do not total correctly. Hopefully someone can make this work!

 

https://www.dropbox.com/s/l7xi0rdgr5x2vdj/IncentiveSampleData.pbix?dl=0

 

 

Hi,

In the first visual, the Points add up to 406 whereas they should add upto 408.  This measure gives the result as 408

Measure = SUMX(Targets,[Points])
Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hoping to bump this to see if there may be a solution? 

 

@amitchandak - do you have any thoughts?

 

Thanks

amitchandak
Super User
Super User

@AndySmith , This because data is grouped to customer level and then do the calculation. So you grand total are calculated again using customer level

 

For state you might have to do

Points = SUMX(VALUES('BrandPrint'[State Name]),CALCULATE(IF([New Listings Count]=0,0,IF(AND([New Listings Count]>=1,[Product Count]=4),12,[Product Count]*2))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.