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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
haoqizha
Frequent Visitor

How to sum a table with filter and conditions

Hi,

 

I have got a table as below:

 

ClientProduct_NameDateSalesQTY
AAPPLE07/08/2022$10030
BAPPLE07/08/2022$20020
ABANANA06/08/2022$5020
BBANANA06/08/2022$4025
ACHERRY05/04/2022$3030
BMELON03/04/2022$2030

 

The expected result is to create:

 

ClientProduct_NAMEDateTotal sales by ProductWeight of client
AAPPLE07/08/2022$300=100/300 
BAPPLE07/08/2022$300=200/300
ABANANA06/08/2022$90=50/90
BBANANA06/08/2022$90

=40/90

ACHERRY05/04/2022$30=30/30
BMELON03/04/2022$20=20/20

 

I can't figure out how to let DAX (new measure) to calculate "Total sales by Product", that is supposed to sum by the same Product_Name across all Client within a same Date. Suppose once this is done, the Weight of client part should be fairly simple.

 

Thanks!

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Untitled.png

 

Sales all by product: = 
CALCULATE ( [Sales measure:], ALLEXCEPT ( Data, Data[Product_Name] ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Untitled.png

 

Sales all by product: = 
CALCULATE ( [Sales measure:], ALLEXCEPT ( Data, Data[Product_Name] ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


haoqizha
Frequent Visitor

Apologize for the bad formating. Date ends with 2022, so "300, 300, 90" etc are the sales figure.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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