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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Shineccx007
Helper I
Helper I

DAX Calculate Sum under multiple columns in a table

Hello!

 

I created a measure on calculating Sum quantity under several column filters under the same table. 

 

Inventory On Hand =
CALCULATE(
    SUM(WarehouseEntries[Quantity]),
    FILTER(WarehouseEntries, WarehouseEntries[Location_Code] = "PLANT" || WarehouseEntries[Location_Code] = "CF TORBRAM" || WarehouseEntries[Location_Code] = "PANEX" ||WarehouseEntries[Location_Code] = "WAREHOUSE" || WarehouseEntries[Bin_Code] <> "CAKE C" || WarehouseEntries[Bin_Code] <>"CD C" || WarehouseEntries[Bin_Code]<> "COSTCO C" || WarehouseEntries[Bin_Code]<> "DISPOSE" || WarehouseEntries[Bin_Code]<>"FMIX C" || WarehouseEntries[Bin_Code]<> "GB C" || WarehouseEntries[Bin_Code]<>"GB MIX"|| WarehouseEntries[Bin_Code]<>"JELLY C" || WarehouseEntries[Bin_Code]<>"OUTPUT" || WarehouseEntries[Bin_Code]<>"OV1 C" ||WarehouseEntries[Bin_Code]<>"OV2 C" ||WarehouseEntries[Bin_Code]<>"PD01-1" || WarehouseEntries[Bin_Code]<>"PDWH"|| WarehouseEntries[Bin_Code]<>"PENDING" || WarehouseEntries[Bin_Code]<>"PENDING2"|| WarehouseEntries[Bin_Code]<> "PREMIX"|| WarehouseEntries[Bin_Code]<>"PREMIX C" || WarehouseEntries[Bin_Code]<>"RD C"||WarehouseEntries[Bin_Code]<>"SAMPLES"|| WarehouseEntries[Bin_Code]<>"SP C" || WarehouseEntries[Bin_Code]<>"STAGE"||WarehouseEntries[Bin_Code]<>"STORAGE1"|| WarehouseEntries[Bin_Code]<>"SUPPORT C"|| WarehouseEntries[Bin_Code]<>"SYRUP C" || WarehouseEntries[Bin_Code]<>"DOUGH C" || WarehouseEntries[Bin_Code]<>"TART C" || WarehouseEntries[Bin_Code]<>"XBMIX C"|| WarehouseEntries[Bin_Code]<>"XCONSIGN" || WarehouseEntries[Bin_Code]<>"XFC C"|| WarehouseEntries[Bin_Code]<>"XSYRUP" || WarehouseEntries[Bin_Code]<>"SHIP"|| WarehouseEntries[Bin_Code]<>"FMIX C")
)
 

 

But when I drag the item code, location code, bin code and quantity to the visual table under Power BI, the bin code is still showing the data I don't need. And the quantity didn't seem any different to what I have from the original quantity Sum. Anyone can have a look at what's going on?

 

Replicating Tableau Parameter/Filter in Power BI 

 

Thank you!

 

Shine

3 REPLIES 3
3CloudThomas
Super User
Super User

My misitake, it does look like you need the OR (||) operator.
Maybe the issue is too many comparisons in one Measure.
Try to break it up into multiple measures and test one condition at a time until you see the issue come up

 

3CloudThomas
Super User
Super User

|| is the OR operator, maybe try the AND operator - &&

Hi Thomas,

 

After I changed all the || to &&, I cannot see any valid data in the matrix table.

 

Did I make anything wrong?

 

Shine

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.