Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hello,
I am quite new to DAX, and I would like to make a Measure that computes different normal distributions based on a string type defined in another column.
Here is the sample table:
Now each type has a different mean and standard deviation I want to put into my calculation, so the Switch statement should look similar to this:
Distribution Value =
SWITCH(
TRUE(),
SUM('Normal Distribution'[Type])="A",
NORM.DIST(SUM('Normal Distribution'[X-Values]),240,100,FALSE()),
SUM('Normal Distribution'[Type])="B",
NORM.DIST(SUM('Normal Distribution'[X-Values]),350,75.6,FALSE()),
SUM('Normal Distribution'[Type])="C",
NORM.DIST(SUM('Normal Distribution'[X-Values]),312,120,FALSE()),
0
)However, I know this is wrong, because you cannot use SUM() with strings, but without using SUM(), I don't know how to access the 'Normal Distribution'[Type] column.
Can anyone take a look? I hope this is quick. Thank you!
Solved! Go to Solution.
@Anonymous -
I do not know what the answers are supposed to be however, using SELECTEDVALUE ( ) seems to not cause an error.
Distribution Value =
SWITCH(
TRUE(),
SELECTEDVALUE('Normal Distribution'[Type])="A",
NORM.DIST(SUM('Normal Distribution'[X-Values]),240,100,FALSE()),
SELECTEDVALUE('Normal Distribution'[Type])="B",
NORM.DIST(SUM('Normal Distribution'[X-Values]),350,75.6,FALSE()),
SELECTEDVALUE('Normal Distribution'[Type])="C",
NORM.DIST(SUM('Normal Distribution'[X-Values]),312,120,FALSE()),
0
)
Proud to be a Super User!
@Anonymous -
I do not know what the answers are supposed to be however, using SELECTEDVALUE ( ) seems to not cause an error.
Distribution Value =
SWITCH(
TRUE(),
SELECTEDVALUE('Normal Distribution'[Type])="A",
NORM.DIST(SUM('Normal Distribution'[X-Values]),240,100,FALSE()),
SELECTEDVALUE('Normal Distribution'[Type])="B",
NORM.DIST(SUM('Normal Distribution'[X-Values]),350,75.6,FALSE()),
SELECTEDVALUE('Normal Distribution'[Type])="C",
NORM.DIST(SUM('Normal Distribution'[X-Values]),312,120,FALSE()),
0
)
Proud to be a Super User!
Thanks, that did what I wanted it to do.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 17 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 37 | |
| 29 | |
| 24 |