Forum Discussion

LangeJan's avatar
LangeJan
Icon for Helper I rankHelper I
4 years ago
Solved

Table rows from measure not correct - Total amount correct

Hi
I work for a bookstore will show how much of the turnover is sold in hard copy format ('Papir' in Danish).

I have made the measure below. The total amount is correct (PFD not included), but in the table I can also see rows including PDF even though PDF is not counted in the total.
PDF is only displayed in the table in cases where the same item number is sold in both PDF and hardcopy on the same order number.
Can anyone answer how I get PDF off the table?

Thank you


Turnover PAPIR =
CALCULATE(SUM('AX_CUSTINVOICETRANS'[LINEAMOUNTMST]);'AX_CUSTINVOICETRANS'[DS_PUBFORM]="papir")



 
  • LangeJan  try this

    Turnover PAPIR =
    CALCULATE (
        SUM ( 'AX_CUSTINVOICETRANS'[LINEAMOUNTMST] ),
        FILTER (
            VALUES ( 'AX_CUSTINVOICETRANS'[DS_PUBFORM] ),
            'AX_CUSTINVOICETRANS'[DS_PUBFORM] = "papir"
        )
    )
    

3 Replies

  • ValtteriN's avatar
    ValtteriN
    Icon for Community Champion rankCommunity Champion

    Hi,

    I think the most straightforward solution is to filter DS_DUBFORM on a visual level so either just place a filter here: 



    Or include a slicer selection on your report and use a simple dax like:
    Revenue = SUM('AX_CUSTINVOICETRANS'[LINEAMOUNTMST])

    If there isn't any specific reason to hard-code your product category selection I would stick to a slicer selection or a filter.

    E.g. Slicer (in your example place 'AX_CUSTINVOICETRANS'[DS_PUBFORM] in the slicer)



    I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!



  • smpa01's avatar
    smpa01
    Icon for Community Champion rankCommunity Champion

    LangeJan  try this

    Turnover PAPIR =
    CALCULATE (
        SUM ( 'AX_CUSTINVOICETRANS'[LINEAMOUNTMST] ),
        FILTER (
            VALUES ( 'AX_CUSTINVOICETRANS'[DS_PUBFORM] ),
            'AX_CUSTINVOICETRANS'[DS_PUBFORM] = "papir"
        )
    )
    
    • LangeJan's avatar
      LangeJan
      Icon for Helper I rankHelper I

      Thanks smpa01 - this solution solved my problem exactly as I wanted it.