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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
vfx661
Advocate I
Advocate I

Get value from a table column - concisely

I'm coming from R where for a table called 'tbl' we can get a value like this:
tbl[i, j]

or if the table only has one row
tbl[j]

Is there something similar in DAX? 

I've been using 

FIRSTNONBLANK(tbl[j], 1
and this gets unreadable fast since I'm using a lot of values from the table.

Please note - there are some differences if j is a number, string or variable name - in this case please assume j is a string value.

##  Updated 30 July 2024 ##

Please find example attached.  In the example (sorry it seems no option to attach a PBIX), the user selects a country and the country and capital are shown as a crumb on the right side.  The measure DAX is also shown in a text box bottom left, and a preferred DAX (which doesn't work but indicates my intent) is on the right.

vfx661_0-1722296907617.png

 

I'm flexible with the syntax, the main problem with the working approach besides the verbosity is that I have to get the FIRSTNONBLANK value twice, and if it is a big table, then this is not as performant as being able to get a single row and then take the values from that row.  




3 REPLIES 3
vfx661
Advocate I
Advocate I

I can't see an option to share a PBIX... image, video is there, but not option to share a file.
 

@vfx661  Save it in some cloud drive and share via link

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Ritaf1983
Super User
Super User

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.