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
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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