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
JenaT
Frequent Visitor

% of one product sales from total sales (accept filtering by date, but do not filter by product)

I am trying to calculate a separate measure for a table of selected products - "% of selected Product sales from all sales". All the sales data for a bunch of products (incl. other products) is in a separate table.

Currently i have tried = sum(sales data [Sales])/calculate(sum(sales data [Sales]),allexept(sales data [Products])

 

In the report there is filtering by dates and by products. Filtering by dates is needed, but filtering by products results in wrong measure result (obviously the divisor calculation is wrong).

Could someone please help?

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @JenaT,

 

Please modify your measure as:

% per product =
SUM ( 'sales data'[Sales] )
    / CALCULATE ( SUM ( 'sales data'[Sales] ), ALL ( 'sales data'[Products] ) )

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @JenaT,

 

Please modify your measure as:

% per product =
SUM ( 'sales data'[Sales] )
    / CALCULATE ( SUM ( 'sales data'[Sales] ), ALL ( 'sales data'[Products] ) )

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft

Thanks!

 

I get the error: Multiple table arguments are not allowed in the ALL/ALLNOBLANKROW function.

I am actually trying to calculate this in another table (home: product table), because the sales table is very crowded. 

 

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.