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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Calculation of Sum with Filters - Which is right DAX to use?

This is probably an easy solution for you guys but I'm rusty on my Dax. 

 

I'm trying to create a visualization that includes one column of filtered sales data (by a field in my item master called "manufacturer") and a separate calculation that is the TOTAL of the category that still includes the data being filtered in the prior column.  This is an OVERLY simplified model of my sales data, and a relatively simple output for the visualization as well. Eventually I'll bring in time intelligence, changes vs prior year etc. I've addressed this in past with slicers but the slicer then filters out all the sales data so I can't have both the manufacturer and total category sales on the same visualization. 

 

I just need to understand what is the appropriate command to create the filtered sales columns and unfiltered category sales columns. 

 

 

EXAMPLE OF DATA TABLE   
Item DescriptionCategoryManufacturerWeek #Sales
Item 1WidgetCompany 11$25
Item 2CordsCompany 11$40
Item 3WidgetCompany 21$33
Item 4CordsCompany 21$50
Item 5WidgetCompany 31$18
Item 6CordsCompany 31$45
Item 7WidgetCompany 41$22
Item 8CordsCompany 41$47

 

EXAMPLE of DESIRED VISUALIZATON

 

 Company 1Category TTL (Thus should including Company 1 as part of the sum)
Widgets$25$98
Cords$40$182
1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

5 REPLIES 5
Whitewater100
Solution Sage
Solution Sage

Hello:

I rearranged the model a bit, to make it easier.

https://drive.google.com/file/d/1gBSzt8Ji9gQvrIweCKIB0uy8N5QLW5h4/view?usp=sharing 

 

Whitewater100_0-1647962361602.png

 

Anonymous
Not applicable

This helped! Thanks.

Anonymous
Not applicable

Category and company are both supplemental fields in the item master. The item id# and sales come from my weekly sales data imports and then are linked in a relationship. 

amitchandak
Super User
Super User

@Anonymous , Unpivot category and company in power query and try

 

https://radacad.com/pivot-and-unpivot-with-power-bi

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

sorry to clarify...

My Data Table Only Includes sales data not the deeper item description or manufacturer details:

 

Item Code

$ Sales

Week 

 

My Item Master Table Includes

Item Code (Key Field)

Manufacturer

Category

etc.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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