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 nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
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.
| User | Count |
|---|---|
| 23 | |
| 22 | |
| 21 | |
| 18 | |
| 11 |
| User | Count |
|---|---|
| 56 | |
| 54 | |
| 43 | |
| 36 | |
| 34 |