Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I am new Power BI so the answer may be obvious. I have two indivdual mesures which work (one shows the average of the data, the other shows the median). however am having issues when using a switch.
When I click on Average the data show ...
But when I click on the Median I get ...
Using the mesure only without the switch does show the data
The Switch code is
"SWITCH(VALUES('Calculation Method'[Calc Method]),"Average",[Average Wait List],"Median",[Median Wait List])"
How do I fix it ?
Solved! Go to Solution.
Thanks for all the response, the solution was a ghost space. the 'Calculation Method' table actually had a leading space (e.g., " Median"). Now it's working
Thanks for all the response, the solution was a ghost space. the 'Calculation Method' table actually had a leading space (e.g., " Median"). Now it's working
Please try the measure below:
Avg/Med Wait List =
VAR _method = SELECTEDVALUE ( 'Calculation Method'[Calc Method], "Average" )
RETURN
SWITCH (
_method,
"Average", [Average Wait List],
"Median", [Median Wait List],
[Average Wait List]
)
Hi @NewtoROB
Could be a few issues.
On the top of my head, issues could be relating to:
Would you be able to provide a sample model?
Hi,
Share the download link of the file.
Hello @NewtoROB
Try this DAX
Selected Wait List :=
SWITCH(
SELECTEDVALUE('Calculation Method'[Calc Method]),
"Average", [Average Wait List],
"Median", [Median Wait List]
)
thanks for the response, however it didnt fix it
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 69 | |
| 45 | |
| 36 | |
| 28 | |
| 23 |
| User | Count |
|---|---|
| 142 | |
| 124 | |
| 59 | |
| 40 | |
| 32 |