cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StuartSmith
Impactful Individual
Impactful Individual

Store row value in a var.

How can I store a row value in a var? I have a coulmn in a table called 'Master Data'[Required Staff] that contains the number of staff at an office.  How can I get the row value stored in a var?

 

Was tying something like "Var RequiredStaff = 'Master Data'[Required Staff], but when typing the table name, it only shows measures for the "Master Data" table and not the columns.  Ideally, I dont want to create a measure to use in the Var as trying to create a single measure and not multiple measures.  

 

Hope that makes sense and thanks in advance.

 
 
 
1 ACCEPTED SOLUTION
FreemanZ
Community Champion
Community Champion

hi @StuartSmith 

Var RequiredStaff = 'Master Data'[Required Staff]

 

works only when you have a proper row contex. Otherwise, try like:

 

Var RequiredStaff = MAX('Master Data'[Required Staff])

View solution in original post

2 REPLIES 2
FreemanZ
Community Champion
Community Champion

hi @StuartSmith 

Var RequiredStaff = 'Master Data'[Required Staff]

 

works only when you have a proper row contex. Otherwise, try like:

 

Var RequiredStaff = MAX('Master Data'[Required Staff])

Thanks

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors