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
AKor
New Member

filters

Hello,

I was wondering if anybody can help me with a formula. I have a set of salespeople who are responsible for different products. I created a formula which overwrites existing filter on salesperson, so I can see total sales for the product regardles of the salesperson. I have Total Sales= calculate(sum([sales amount], ALL(sales[salesperson], but then I want to use it in the table which will filter on the salesperson and only show Total Sales for products sold by filtered sales people. However, it lists everything now, because I used ALL as a overwrite for that filter. How can I keep filter in the formula calculation but when still apply it to a visual which use this calculation. Thank you!

1 ACCEPTED SOLUTION

Hi Lydia,

In your example, what I need as a result is to have $8,341,224,364.83 but only showing one  Class Name - Economy. I think I found the solution to it by creating the additional measure which I use as a filter: IF(sum(Sales[SalesAmount])>0,1,0) and then I filter on 1. In this case I use ALL in the original measure instead of ALLSELECTED, and it seems to work.

 

Thank you for your help!

View solution in original post

5 REPLIES 5
v-yuezhe-msft
Employee
Employee

@AKor,


I make a test using my sample data, everything works well, you can review the following screenshots.
1.JPG2.JPG

Could you please share dummy data of your table? I will test it in my environment.


Regards,
Lydia

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

Hi Lydia,

In your example, what I need as a result is to have $8,341,224,364.83 but only showing one  Class Name - Economy. I think I found the solution to it by creating the additional measure which I use as a filter: IF(sum(Sales[SalesAmount])>0,1,0) and then I filter on 1. In this case I use ALL in the original measure instead of ALLSELECTED, and it seems to work.

 

Thank you for your help!

Zubair_Muhammad
Community Champion
Community Champion

Hi @AKor

 

Try replacing ALL with ALLSELECTED

 

Total Sales =
CALCULATE ( SUM ( [sales amount] ), ALLSELECTED ( sales[salesperson] ) )

Regards
Zubair

Please try my custom visuals

I tried this option but it does not work, it still returns all products regardless if this sales person sells it or not.

To clarify a bit, I am trying to use slicers not filters, so ALLSELECTED does not work in this case.

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.