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
Axiomite
Resolver II
Resolver II

SWITCH Function and Power Bi value calculations

Hi there, 

 

I've been running into problems where I use a switch function and it seem to be skewing my end result, especially where multiplication takes place with a value derived from a switch fucntion. I am unable to replicate my issue with my dummy data and cannot share the sensitive data. However I've attached a link to a pbix and dummy data in Excel. 
1. Instead of switch in Dax I can do this in SQL and and get my end result with basic Dax.

2. Being said I can solve with SQL, can you see if I took the correct approach with DAX, as this is bothering me and would love a better understanding? I get confused with the SUM, Dont summarize etc and this seems to have an effect on the end result. 

Axiomite_0-1708670662990.png

Link to dummy data: 

https://drive.google.com/drive/folders/1Kev8YiUNUUyCYRxW7XkxXYWlAagXwWL0?usp=sharing 

 

2 REPLIES 2
Daniel29195
Super User
Super User

@Axiomite 

can you explain the logic of the code you are trying to write ? 
like what do you want to calculate  ? 

@Daniel29195 
are you able access my shared documents? I've added another worksheet on the shared excel file, this will show you what I want to calculate. Thanks for your time.

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.