Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Alex-PBIComm
Helper II
Helper II

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.

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Alex-PBIComm ,

 

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.

Capture.PNG

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @Alex-PBIComm ,

 

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.

Capture.PNG

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hello @v-jayw-msft,

It works! Thanks a lot 😃

Thanks a lot @v-jayw-msft , I'll test asap and get back to you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.