Forum Discussion

laetitiaf's avatar
laetitiaf
Frequent Visitor
1 year ago
Solved

Calculating invoice margin total

Hey,    I'm stuck on how I can summarise the invoice margin for the whole invoice and was wondering how this can be achieved in a dax measure?   For example, in this table, we have each SKUs marg...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi laetitiaf ,

    Please create a measure as below to get it and check if it can return the correct result...

    Margin Invoice Total =
    VAR _invnum =
        SELECTEDVALUE ( 'Table'[Invoice Number] )
    RETURN
        SUMX (
            FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Invoice Number] = _invnum ),
            [Margin]
        )

    If the above one can't help you figure out, please provide some raw data in your tables(exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

    How to provide sample data in the Power BI Forum

     

    And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards