Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filtering issues while calculating coloumn

Hello everyone,

 

i want to create a calculated coloumn which should show a sum of an amount based on the customer id and the amount the customer has to pay which is related to a "reason you have to pay this many"- ID. 

 

zz_ep = CALCULATE(SUMX('RPÜ_Report','RPÜ_Report'[Betrag]),FILTER(ALL('RPÜ_Report'),'RPÜ_Report'[ID]=11))
 
This formula sums up all values (ID=11) even when i filter for a specific customer. The goal is to get a value when i filter e.g customer = 1615211100 ( sum of all the "Betrag" values) or a value for specific reasons (ID) for the customers. E.g I want to see the amount for two customers for the ID´s = 20 and = 5. 1615211100 in this case should have the sum of two id´s whereas the other two with ID=20 should have a different amount. 
 
I tried a couple of workarounds from this community but I was not able to get this going. I hope you can help me out. 
 
e.g 
HL_EP = var rpue_grund = 'RPÜ_Grund'[iid]
Return
CALCULATE(Sum('RPÜ_Report'[Betrag]),FILTER(All('RPÜ_Report'[ID]),'RPÜ_Report'[ID] in rpue_grund))
 
Grateful for any advice, help, tricks and tips!
 
Cheers.

  • Hi, Anonymous ;

    Try it;

    HL_EP =
    VAR rpue_grund = 'RPÜ_Grund'[iid]
    RETURN
        CALCULATE (
            SUM ( 'RPÜ_Report'[Betrag] ),
            FILTER ( ALLSELECTED ( 'RPÜ_Report'[ID] ), 'RPÜ_Report'[ID] IN rpue_grund )
        )
    

     

    zz_ep =
    CALCULATE (
        SUM ( 'RPÜ_Report'[Betrag] ),
        FILTER ( ALLSELECTED ( 'RPÜ_Report' ), 'RPÜ_Report'[ID] = 11 )
    )
    


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    Try it;

    HL_EP =
    VAR rpue_grund = 'RPÜ_Grund'[iid]
    RETURN
        CALCULATE (
            SUM ( 'RPÜ_Report'[Betrag] ),
            FILTER ( ALLSELECTED ( 'RPÜ_Report'[ID] ), 'RPÜ_Report'[ID] IN rpue_grund )
        )
    

     

    zz_ep =
    CALCULATE (
        SUM ( 'RPÜ_Report'[Betrag] ),
        FILTER ( ALLSELECTED ( 'RPÜ_Report' ), 'RPÜ_Report'[ID] = 11 )
    )
    


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.