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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
E_
Frequent Visitor

Calculating total useing ALLEXCEPT

I'm calculating the totals using ALLEXCEPT. What I want is: given an ID (that can be on more than one segment) I want its segment industry.

E__1-1724277644466.png

 

It only works on the second level, the first level it's calculating the sum of the month (161,615) like the following and not 17,186 + 16,889 = 34,075 that is the industry of ID .

 

E__2-1724277855003.png

 

Obs.: ID and Segment is on the same table.

 

My measure is:

 

 

 

CALCULATE(
    SUM(Consolidated[quantity]),
    ALLEXCEPT(
        Consolidated,
        Consolidated[channel1],
        Consolidated[channel2],
        Consolidated[segment],
        Consolidated[division],
        Consolidated[region],
        Consolidated[district]
    ),
    TREATAS(VALUES('Calendar'[Date]), Consolidated[registration_date]),
    Consolidated[company] <> BLANK()
)

 

 

 

 

 

2 REPLIES 2
v-yohua-msft
Community Support
Community Support

Hi, @E_ 

Based on your information, I create a sample table:

vyohuamsft_0-1724292881902.png

Then create a new measure and try the following DAX expression:

Measure = CALCULATE(
    SUM('Table'[quantity]),
    ALLEXCEPT(
        'Table',
        'Table'[ID],  -- Ensure ID is included in the ALLEXCEPT function
        'Table'[channel1],
        'Table'[channel2],
        'Table'[segment],
        'Table'[division],
        'Table'[region],
        'Table'[district]
    ),
    TREATAS(VALUES('Calendar'[Date]), 'Table'[registration_date]),
    'Table'[company] <> BLANK()
)

Here is my preview:

vyohuamsft_1-1724292979692.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

It calculates a normal SUM

E__1-1724334940003.png

 

What I want to do is: given the ID1, give me back the industry of Segment 1 + industry of Segment 2 (17,186 + 16,889) when we are looking at the first level and not the month total.

E__3-1724334986199.png

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.