Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure with customized totals

Good afternoon everyone,

 

I'll try to be brief as everytime I post this message it goes to spam. Don't hesitate to ask for more info if the request is not clear.
I'd like to create a measure that displays a total calculated differently from the rows. I have a table with the total value of sales in local currencies and through SWITCH + Slicers I allow the user to recalculate the values for all markets converted in dollars.
My goal is, when the "local currency" view is selected, to see the total always in dollars.

Thanks in advance for your help!}

Edit: example

Example of values with Local Currency: https://i.stack.imgur.com/t7kFb.png

And Converted: https://i.stack.imgur.com/MpB4m.png

So in this example, when "Local Currency" is selected in the slicer I'd like to see the first table, but with total 33,213,082 instead of 4,000,837,690.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please try using ISINSCOPE() or ISFILTERED() function.

    https://docs.microsoft.com/en-us/dax/isinscope-function-dax 

    https://docs.microsoft.com/en-us/dax/isfiltered-function-dax 

    It will return TRUE in commen rows and return FALSE in total row.

    So that you will need to create separate calculations for common rows and total row.

    Return total calculation when false and return common calculation when true, like:

    Measure = 
    var common = [common]

    var total = [total]

    return
    IF(ISINSCOPE([column]),[common],[total])

     

    Best Regards,

    Jay

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks a lot Anonymous , I'll test asap and get back to you

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Anonymous,

      It works! Thanks a lot 😃