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

Create Total Measure with a Slicer

Hi guys, 

 

Fairly new to PowerBI so would be great if someone can enlighten me here on what formula I should use. 

 

Table columns: 

Date

Product Category

Quantity Sold

 

I did the following:

1. Created a measure called "Total Sold" which is the sum of the quantity sold column.

2. In visual, I added a slicer based on the Date - so that I can filter on quarters. 

3. In visual, I also created a matrix with Product Category as rows, and "Total Sold" as the first column. 

 

I want to:

a. Create a measure which calculates the total of quantity sold

b. Create another measure which calculates the % of total (so, will be Total sold Divided by the new measure created above.) 

 

For a., I used formula "calculate([Total sold], all ('table_name')). However, it looks like it removed all filters, including the one that came from the slicer and returned the total quantity, while I wanted it to return the total quantity for the selected quarter on the slicer. Can anyone please help? 

 

Thanks! 

1 ACCEPTED SOLUTION
Arul
Super User
Super User

@AbbyLear ,

try this

calculate([Total sold], ALLSELECTED ('table_name'))

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

3 REPLIES 3
Arul
Super User
Super User

@AbbyLear ,

try this

calculate([Total sold], ALLSELECTED ('table_name'))

Thanks,

Arul





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


AbbyLear
Frequent Visitor

It worked! Thanks a lot Arul. 

@AbbyLear ,

If it solves your issue, mark it as accepted solution and a kudo would be great!!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


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.

Top Solution Authors