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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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