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

Sum of turnover where no reference price exists

Hello,
I've the following issue. I've got 3 table.
a) fact table - includes actual turnover on material number level
b) calendar
c) reference price - linked to fact table by material number (is only a reference but is not the price per item to calculate turnover)

I want to calculate the turnover for all materials that have no reference price. May current formula which works on material number level:

 

Sum_missing_ref-price YTD CY (EUR) :=
IF (
    ISBLANK (
        CALCULATE (
            SUM ( REF_price[EU reference price) (EUR)] );
            DATESYTD ( 'Calendar'[Date]; "12/31" )
        )
    );
    [Turnover YTD CY (EUR)];
    0
)

 



However, I don't get a sum on overall level (result is blank for sum over materials that have reference prices and have not reference prices.

The following formula gives me no results. Even not on single material level.

 

Count_missing_ref-price YTD CY (EUR)2 :=
CALCULATE (
    SUM ( Sales_Cond[Condition value (LC)] );
    FILTER (
        REF_price;
        IF (
            ISBLANK (
                CALCULATE (
                    SUM ( REF_price[EU reference price (EUR)] );
                    DATESYTD ( 'Calendar'[Date]; "12/31" )
                )
            );
            [TGS YTD CY (EUR)];
            0
        )
    )
)

 

 

What am I doing wrong?

Thanks in advance for any hints.

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

Sum_missing_ref-price YTD CY (EUR) :=
sumx(values(facttable[material_id]);IF (
    ISBLANK (
        CALCULATE (
            SUM ( REF_price[EU reference price) (EUR)] );
            DATESYTD ( 'Calendar'[Date]; "12/31" )
        )
    );
    [Turnover YTD CY (EUR)];
    0
))

View solution in original post

1 REPLY 1
wdx223_Daniel
Super User
Super User

Sum_missing_ref-price YTD CY (EUR) :=
sumx(values(facttable[material_id]);IF (
    ISBLANK (
        CALCULATE (
            SUM ( REF_price[EU reference price) (EUR)] );
            DATESYTD ( 'Calendar'[Date]; "12/31" )
        )
    );
    [Turnover YTD CY (EUR)];
    0
))

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.