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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
amsrivas
Helper IV
Helper IV

How to capture single column value from table in Text

Hi Folks!!

I have a table with one column say Country and it has just one value (always) say INDIA, though the name name of the country can be changes but number of rows remains 1.

 

I just want to capture this value in Text variable in Power BI M Query.

 

Please suggest!!

Thanks

Amit 

2 ACCEPTED SOLUTIONS
HotChilli
Super User
Super User

You can use Table{0}[Column] to refer to it (use your table and column names).

You can put it in a variable with an assignment e.g.

p = TableA{0}[Column1]

View solution in original post

Hi @HotChilli ,

 

Thanks for your answer, it works well.

p = TableA{0}[Column1]

 

However, i too find some other way out to achieve the goal, below is the code.

varName=Table.FirstValue(TableName)

 

This will give first column of first row.

 

Thanks

Amit Srivastava

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

You can use Table{0}[Column] to refer to it (use your table and column names).

You can put it in a variable with an assignment e.g.

p = TableA{0}[Column1]

Hi @HotChilli ,

 

Thanks for your answer, it works well.

p = TableA{0}[Column1]

 

However, i too find some other way out to achieve the goal, below is the code.

varName=Table.FirstValue(TableName)

 

This will give first column of first row.

 

Thanks

Amit Srivastava

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors