Forum Discussion

nielsrask's avatar
nielsrask
Regular Visitor
9 years ago
Solved

DAX Formula for subtracting columns?

Hi, I have created a matrix table from my data base.   Now, I would like to subtract two of the columns from each other and put the result in a new column.   Can I do it directly in the visual or...
  • Anonymous's avatar
    Anonymous
    9 years ago

    nielsrask,

    Create the following measures in your table and drag the result measure in your visual.

    totalforspecies = CALCULATE(SUM('EKRN-a482911f-cdbf-4b5f-9e2d-8cde02e7f164-31_05_2017_clean july 2017'[species-count]))

    totalforblankaction = CALCULATE([totalforspecies],'EKRN-a482911f-cdbf-4b5f-9e2d-8cde02e7f164-31_05_2017_clean july 2017'[action-taken]="")

    result = [totalforspecies]-[totalforblankaction]

    For more details, please review the attached PBIX file.

    Regards,
    Lydia