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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.