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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
KenLucaaaaaa
Frequent Visitor

SUMX Totals in matrix not correct with if-condition on lowest level

Hi, I want to check on a customer-article-month level, if an artcile was out-of-stock and if not out-of-stock, then write a 1.
This 1 I want to add up then per customer-article-month combination.
 
Currently I get the following matrix:
 
KenLucaaaaaa_0-1700210318430.png

 

 But what I want is the following:

KenLucaaaaaa_1-1700210431022.png



So in this case it is filtered for 6 customers, that's why in the matrix there is always a 6 when the article is not out-of-stock. But the totals are not correctly calculated, both for rows and for columns. What am I doing wrong?

Thanks! 🙂

 
OOS ja/nein =
SUMX(
    VALUES(D_Date[MonatID]),
    SUMX(
        VALUES(D_Products[Product_Description]),
        SUMX(
            D_Kunde,
            IF(
                SUM(F_OutofStockHistory[AnzahlTageOoS]) > 0,
                0,
                1
            )
        )
    )
)
1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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