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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Min_02
Regular Visitor

ALL not working properly with slicer

Hi everyone,

 

I have a measure: Total sales = calculate(SUM(Sales_1[Sales]), ALL(Sales_1[Store Name]))

 

Then, I have a table where I have "Brands" on rows, and the created measure "Total Sales" and "Sales" on columns. The created measure is working as expected, but then, I have a slicer with "Store Name", to see only the values for that store. However, when I select a store on the slicer, the created value that should show the total value independently on the selected store on slicer, is not working properly, as for some stores, it shows a different value.

 

Any idea on how to correct this so even selecting a value on the slicer, the value showed is the same?

 

Thanks a lot

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Min_02 ,

 

How about this?

 

1. Create a new SlicerTable.

SlicerTable = VALUES ( Sales_1[Store Name] )

 

2. Change your measure like so:

Total sales =
VAR SelectedStore =
    SELECTEDVALUE ( 'SlicerTable'[Store Name] )
RETURN
    IF (
        SelectedStore = BLANK (),
        CALCULATE ( SUM ( Sales_1[Sales] ), ALL ( Sales_1[Store Name] ) ),
        CALCULATE ( SUM ( Sales_1[Sales] ), Sales_1[Store Name] ) = SelectedStore
    )

 

3. Use 'SlicerTable'[Store Name] as a Slicer.

 

 

Best Regards,

Icey

 

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

7 REPLIES 7
Icey
Community Support
Community Support

Hi @Min_02 ,

 

Is this problem solved?


If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.


If not, please let me know.

 

 


Best Regards,
Icey

Icey
Community Support
Community Support

Hi @Min_02 ,

 

How about this?

 

1. Create a new SlicerTable.

SlicerTable = VALUES ( Sales_1[Store Name] )

 

2. Change your measure like so:

Total sales =
VAR SelectedStore =
    SELECTEDVALUE ( 'SlicerTable'[Store Name] )
RETURN
    IF (
        SelectedStore = BLANK (),
        CALCULATE ( SUM ( Sales_1[Sales] ), ALL ( Sales_1[Store Name] ) ),
        CALCULATE ( SUM ( Sales_1[Sales] ), Sales_1[Store Name] ) = SelectedStore
    )

 

3. Use 'SlicerTable'[Store Name] as a Slicer.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Min_02 , move store to a separate dimension and try

Total sales = calculate(SUM(Sales_1[Sales]), ALL(Store [Store Name]))

Tahreem24
Super User
Super User

@Min_02 , Use the ALLEXCEPT instead of ALL

Total sales = calculate(SUM(Sales_1[Sales]), ALLEXCEPT(Sales_1,Sales_1[Store Name]))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Hi @Tahreem24 , 

 

I'm afraid this doesn't work...

 

Any other idea?

 

Thanks

Mariusz
Community Champion
Community Champion

Hi @Min_02 

 

Use ALLSELECTED instead of ALL

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hi,

 

If I use ALLSELECTED, the measure is working properly if I don't use the "Store name" slicer. However, when I use it, the value that appears is exactly "Sales", not total sales... 

 

Any other idea?

 

Thanks

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.