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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JAS2022
New Member

Calculating Total Sales by Category (multiple lines with the same category)

I am trying to do a scatter plot visual that includes total sales by customer.  The way my dataset is currently setup; there are multiple lines for the same customer (all lines add up to the true total sales).  When I add sales to the scatter plot along with a slicer (that includes sales) to be able to view customers sales by a certain range, Power BI is not reading the true "Total Sales".  See example below on what is occuring.  

 

JAS2022_0-1677190837881.png

 

Customer A total sales = $9

Customer B total Sales = $3 

 

If I slice it to say anything less than $8 customer B should only show, but power BI is reading each individual line and showing customer A at $7.  Is there a way to create a formula or expression to where power BI would read Customer A at a total of $9 and B at $3 so that my slicer would work correctly?  

 

1 REPLY 1
amitchandak
Super User
Super User

@JAS2022 , Create a numeric ?what if param and follwing measure

 

Total Sales = sum(Table[Sales])

 

GT Selected = sumx(values(Table[Filter]), if([Total Sales] >= [Parameter Measure] , [Total Sales], blank() ) )

 

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.