Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
airwolf39
Helper V
Helper V

Why does this variable not work?

Why is the variable 'calc' greyed out at the bottom?

Untitled.png

3 REPLIES 3
ALLUREAN
Solution Sage
Solution Sage

Hi, @airwolf39 

Try to put var calc = ..... just below measure name, and first SWITCH after return

 

Measure = 
var X = [....]

var Y = [,,,,,]

RETURN

SWITCH....




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




The total is now wrong because the variable is outside of the isinscope function 

Text like VAR xyz = [...] cannot be inside, they should stay isolated and used the name xyz in expressions.




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors