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
michael_knight
Post Prodigy
Post Prodigy

Total value of Switch(True() measure in Table Visual

Hi,

 

I created a Switch(True() measure and then used it within a table but it's not displaying the correct values in the total column

 

I believe it may be using the context of the Switch(True() measure within the Total column. 

 

Switch = SWITCH(TRUE(),
[Margin Measure] >= 100, 1000,
[Margin Measure] >= 80, 500) 

 

switch.PNG

In the example above, I want the Switch columns total to be 5,000 rather than 1000

 

https://www.dropbox.com/s/yl5ypb8tz8asim7/help%20-%20Copy.pbix?dl=0

 

Thanks,

Mike

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

Hi @michael_knight ,

 

In your sample data you could use ISINSCOPE() function to create a new measure as below.

Measure = IF(ISINSCOPE(Sheet1[Agent]),[Total],SUMX('Date',[Total]))

8.PNG

 

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 @michael_knight ,

 

In your sample data you could use ISINSCOPE() function to create a new measure as below.

Measure = IF(ISINSCOPE(Sheet1[Agent]),[Total],SUMX('Date',[Total]))

8.PNG

 

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.
ryan_mayu
Super User
Super User

@michael_knight 

here is a workaround for you





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks, won't be able to apply that to my main dataset. Do you have any alternatives?

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.