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

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.

Reply
TimKuehmel
New Member

Using var for finding the right column name...

Hej hej, 

 

I'm searching for the right syntax for using a var in the part of define the right value... 
I think my words are not realy correct but hopefully my example can explain more....

Var TEST= MAX( 'Calendar'[Date(Week)] )
RETURN
CALCULATE ( 10 * MIN('LabStat'[TEST]) )  // <- there is the problem! How can I put the var in it as a column name? I tested much syntax ideas but nothing works...

Thanks a lot 🙂
4 REPLIES 4
Anonymous
Not applicable

Hi  @TimKuehmel ,

Not very clear about your description……the usage of Var is Stores the result of an expression as a named variable, which can then be passed as an argument to other measure expressions, and then you can pass it as a parameter to other measure expressions.

 

You define the expression using Var above, and this TEST is the result of the MAX('Calendar'[Date(Week)]) expression.

And your [TEST] in the CALCULATE (10 * MIN('LabStat'[TEST])) below is equivalent to the column [TEST] in the'LabStat table.

If you want to define a parameter for MIN('LabStat'[TEST]), directly use a Var = MIN('LabStat'[TEST].

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

This is how Var is used:

https://docs.microsoft.com/en-us/dax/var-dax

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

TimKuehmel
New Member

If there is no way, I could build it with a long IF part... But an other way would be better

amitchandak
Super User
Super User

@TimKuehmel , Try like

 

Var _TEST= MAX( 'Calendar'[Date(Week)] )
RETURN
CALCULATE ( 10 * _TEST)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Oh sorry, that don't help me... 
With this var I like to get a value from an other table (a third one). And I like to go there into the right column - the var is saying witch one... 😕

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.