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! Get ahead of the game and start preparing now! Learn more
Hi everyone,
Im having difficulty displaying my maximum value from a table, i would appreciate if anyone could help me.
The error shows that " Argument "6" in function SWITCH is required"
My code:
Solved! Go to Solution.
Hi @Anonymous ,
Please note that your code has an extra comma at the underscore I marked:
If you just want to apply a flag for the max and min value, you could simply use:
Column =
var _max=MAX('energykwh energydata'[energydata_value])
var _min=MIN('energykwh energydata'[energydata_value])
return SWITCH(TRUE(), [energydata_value]=_max,2,[energydata_value]=_min,1)
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please note that your code has an extra comma at the underscore I marked:
If you just want to apply a flag for the max and min value, you could simply use:
Column =
var _max=MAX('energykwh energydata'[energydata_value])
var _min=MIN('energykwh energydata'[energydata_value])
return SWITCH(TRUE(), [energydata_value]=_max,2,[energydata_value]=_min,1)
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous get rid of the last comma in SWITCH
Hi, i still am unabe to extract the maximum value out from the table. Do you by any chance know how to extract the value? My code was not working. This is my table.
@Anonymous can you please provide some sample dat and expected output?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 36 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |