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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Get the first [or only] value of a column of a given filtered table

Hey everyone, what's up?

 

I have a table that looks like this:

tabela-inpc.PNG

The values goes, untill year 2019 month 9.

 

There's only one row for each month-year combination. That means that DataReferencia field is unique (key).

 

It's used for restatement of currency values.

 

It's called 'INPC'.

 

I need a DAX formula that gets the first value of a specified column (in the case, the column NUMERO INDICE) of a filtered given table (in the case, the 'INPC' table).

 

To be clear, here's what I'm looking for:

 

[FUNCTION I'M LOOKING FOR] (
     'INPC'[NÚMERO ÍNDICE];
     TOPN(
          1;
          'INPC';
          'INPC'[DataReferencia];
          DESC
          )
     )

The filtered table I'm passing is a one row table, given by the TOPN function.

That made, I need to get the corresponding value of the NÚMERO ÍNDICE column.

 

To be short, I need a function that will return me the NÚMERO ÍNDICE value corresponding to the most recent date of DataReferencia field. I used TOPN to give me the row corresponding to the most recent date. Now I need a function that gets the unique value of the NÚMERO ÍNDICE column from this filtered table.

 

Any ideas?

1 ACCEPTED SOLUTION
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,

 

Not sure if I understand this, but if you create this measure, you will be able to get the Numero Indice from the row that contains the latest date in the table.  

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

Numero Indice measure = CALCULATE(max(Numero[Numero Indice]),Filter(Numero,Numero[Date]=MAX((Numero[Date]))))

I called my table Numero.

 

 

numero.PNG

numero 1.PNG

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous ,

 

Not sure if I understand this, but if you create this measure, you will be able to get the Numero Indice from the row that contains the latest date in the table.  

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

Numero Indice measure = CALCULATE(max(Numero[Numero Indice]),Filter(Numero,Numero[Date]=MAX((Numero[Date]))))

I called my table Numero.

 

 

numero.PNG

numero 1.PNG

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.