cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Neo_Lyu Frequent Visitor
Frequent Visitor

How to return a measure based on the index value and column name in a table ?

Hi all,

 

Capture.PNG

I got the following table...

 

I want to know how to extract the cell value like CX-11 or 5 based on the LNG_MODEL_SEQUENCE = 1 and column name is STR_MODEL_CODE. The return can be a one cell table or a measure. 

 

Thanks for the help!

1 ACCEPTED SOLUTION

Accepted Solutions
Seward12533 New Contributor
New Contributor

Re: How to return a measure based on the index value and column name in a table ?

Measure
Model code for seq1 = CALCULATE(FIRSTNONBLANK(table[STR_MODEL_Code]),table(LNG_MODEL_SEQUENCE]=1)
For a single cell table
Model code for seq1 = CALCULATE(VALUES(table[STR_MODEL_Code]),table(LNG_MODEL_SEQUENCE]=1)

View solution in original post

3 REPLIES 3
Seward12533 New Contributor
New Contributor

Re: How to return a measure based on the index value and column name in a table ?

Measure
Model code for seq1 = CALCULATE(FIRSTNONBLANK(table[STR_MODEL_Code]),table(LNG_MODEL_SEQUENCE]=1)
For a single cell table
Model code for seq1 = CALCULATE(VALUES(table[STR_MODEL_Code]),table(LNG_MODEL_SEQUENCE]=1)

View solution in original post

Neo_Lyu Frequent Visitor
Frequent Visitor

Re: How to return a measure based on the index value and column name in a table ?

Hi, thanks for the reply! It doesn't work somehow and gives the following warnings.

 

For measure

measure.PNG

 

For table

 

table.PNG

Please give me further hits on this, Thanks!

Neo_Lyu Frequent Visitor
Frequent Visitor

Re: How to return a measure based on the index value and column name in a table ?

Just switch the expression and it works 🙂

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors