cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
katrine_d2o
Helper I
Helper I

ALL and ALLSELECTED not returning the total

Hi,

I am trying to calculate a simple percentage of total sales per category. For example bottle of red wine of all wine.

 

I have tried ALL dax and ALLSELECTED dax:

ALLSELECTED RevPrProdCategory =
CALCULATE(
    [NetRevenue],
ALLSELECTED(POSItemDetails[ProductCategory])
)
 But, I always get the revenue per item. I am working with a live dataset, not sure if that matters. I cannot seem to find a lot of information about working with live data.
katrine_d2o_0-1685690976494.png

Am I doing something wrong? Any suggestions?

 
1 ACCEPTED SOLUTION
AntrikshSharma
Community Champion
Community Champion

@katrine_d2o Description column is sorted by ProductKey or any other column? If yes, then include that column as well in the ALL/ALLSELECTED.

View solution in original post

3 REPLIES 3
katrine_d2o
Helper I
Helper I

Thank you @AntrikshSharma, for responding. But it still does not work. This is from a restaurant where you have product categories. The article (description) belongs to a product categor and a pos category. There is no particular sort order.

As an example, what I want to find out:
The chardonnays sold is X percent of all white wines. For this I need to use the total of white wine, being a POS Category.

Hi again, @AntrikshSharma 

I think I figured it out - I was looking at it wrong. I needed to use description instead of category in the formula. In essence I was looking for the total of all the items/description in a category.

Thanks again

AntrikshSharma
Community Champion
Community Champion

@katrine_d2o Description column is sorted by ProductKey or any other column? If yes, then include that column as well in the ALL/ALLSELECTED.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors