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
omartineztr
Frequent Visitor

Help with CALCULATE and ALLEXCEPT, and Dimensions

I am working with a report that has a Fact table and several dimension tables.

I am trying to calculate a sum of values depending on several filters, so far, I have two "semi" working formulas:

 

FORMULA 1:

_ccAplied =
CALCULATE(
    SUM(FacAccCustomers[AmountLC]),
        ALLEXCEPT(
        FacAccCustomers,
        FacAccCustomers[Table],
        FacAccCustomers[Company],
        FacAccCustomers[Customer],
        FacAccCustomers[Assignment],
        DimCustomer[Name]
        ),
    FacAccCustomers[DocTypeKey]="MRPAB"
)
 
This formula works correctly if the table only has columns from the "Fact" table, however, when I add a column from one of the Dim tables for example DimCust[Name], the resulting table shows all the values from the dimension.
 
omartineztr_0-1709915011935.png

 

FORMULA 2:
_ccAplied_2 =
CALCULATE(
SUMX(
    SUMMARIZE(
        FacAccCustomers,
        FacAccCustomers[Company],
        FacAccCustomers[Customer],
        FacAccCustomers[Assignment],
        "_cc_Net",SUM(FacAccCustomers[AmountLC])),
        [_cc_Net]
),
FacAccCustomers[DocTypeKey]="MRPAB")
 
This formula somehow shows the total value correct, but at row level the cell is blank.
omartineztr_1-1709915029071.png

 

What am I missing here?
Thank you!

1 REPLY 1
lbendlin
Super User
Super User

See if REMOVEFILTERS is a more appropriate approach.

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.