Forum Discussion

NilR's avatar
NilR
Icon for Post Patron rankPost Patron
5 years ago

How in @DAX summarize or Group by Distinct Value

Hi,

I would like to Calculate payments where the ID has Code =U007 and throw out other IDs, Then sum all when Flag <> 0.

Please see the below picture for the final result.

 

LINK TO : SAMPLE DATA  

Thanks!

 

4 Replies

  • Hey NilR ,

     

    please create a PBIX file that contains sample data but still reflects your data model, upload the pbix file to onedrive or dropbox and share the link.

     

    This helps to avoid recreating tables with matching table and column names.

     

    Regards,

    Tom

  • nvprasad's avatar
    nvprasad
    Icon for Solution Sage rankSolution Sage

    Hi,

     

    You can create measure using main table for this without creating any additional tables.

     

    DAX:

    CALCULATE(SUM(MAIN TABLE[PAYMENT]),FILTER(MAIN TABLE, FLAG <> 0 && CODE=U007)

     

    Appreciate a Kudos! ๐Ÿ™‚
    If this helps and resolves the issue, please mark it as a Solution! ๐Ÿ™‚

    Regards,
    N V Durga Prasad

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Icon for Community Support rankCommunity Support

    Hi NilR ,

     

    Sorry, I canโ€™t access this link. Can you change the way of sharing files? I will answer for you as soon as possible.


    Looking forward to your reply.


    Best Regards,
    Henry