Forum Discussion

prashantg364's avatar
prashantg364
Helper II
5 months ago
Solved

DAX

Table create from a dataset.
all column headers are coming from column values
rows are DAX measures.

i need to create a delta column, post-pre

pls suggest


  • Hello,
    try something like calculating Post and Pre separately with CALCULATE filtering that column, then return Post - Pre, basically:

    Delta =
    CALCULATE([your measure], column = "Post") - CALCULATE([your measure], column = "Pre")

    if that doesn’t work it might be because of how the matrix is built, in that case you could also create a disconnected table for Pre/Post/Delta and handle it with SWITCH

    Best regards,
    Daniele

  • You could use a measure as below:

    Delta =
    CALCULATE ( [Amount], 'YourColumn'[Type] = "Post" )
        - CALCULATE ( [Amount], 'YourColumn'[Type] = "Pre" )

4 Replies

  • Hello,
    try something like calculating Post and Pre separately with CALCULATE filtering that column, then return Post - Pre, basically:

    Delta =
    CALCULATE([your measure], column = "Post") - CALCULATE([your measure], column = "Pre")

    if that doesn’t work it might be because of how the matrix is built, in that case you could also create a disconnected table for Pre/Post/Delta and handle it with SWITCH

    Best regards,
    Daniele

  • You could use a measure as below:

    Delta =
    CALCULATE ( [Amount], 'YourColumn'[Type] = "Post" )
        - CALCULATE ( [Amount], 'YourColumn'[Type] = "Pre" )
  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi prashantg364 , Thank you for reaching out to the Microsoft Community Forum.

     

    We find the answer shared by DanieleUgoCopp  is appropriate. Can you please confirm if the solution worked for you. It will help others with similar issues find the answer easily.
    Thank you DanieleUgoCopp  for your valuable response.

  • v-hashadapu's avatar
    v-hashadapu
    Community Support

    Hi prashantg364 , Hope you are doing well. Kindly let us know if the issue has been resolved or if further assistance is needed. Your input could be helpful to others in the community.