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
diegolima
Helper III
Helper III

How to create a column or measure for to search the last value of a determinate column

Hi everyone, everything fine? I need help, I have a problem and I don't know what to do. I have the next table:

 

Sem título2.png

 

I need create a column or measure that showing the last value of PARAMETER from device on the month. The idea is to create a bar graph with the amount of devices that went send a determinate value:

 

Sem título.png

 

In the graph each bar is a parameter value, this bar graph is showing the number of devices that sent each parameter value, I need these parameter values to be the last ones sent in each month.

 

Can someone help me make this column or measure? Thank you all for the attention!

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @diegolima ,

 

Is below what you need?

Annotation 2020-05-25 084632.png

If so,first go to query editor>add column>index column;

Then create a calculated column as below:

 

Last parameter = CALCULATE(MAX('Table'[Parameter]),FILTER('Table','Table'[Index]=EARLIER('Table'[Index])-1&&'Table'[Year-Month]=EARLIER('Table'[Year-Month])))

 

For the related .pbix file,pls click here.

 

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

5 REPLIES 5
v-kelly-msft
Community Support
Community Support

Hi  @diegolima ,

 

Is below what you need?

Annotation 2020-05-25 084632.png

If so,first go to query editor>add column>index column;

Then create a calculated column as below:

 

Last parameter = CALCULATE(MAX('Table'[Parameter]),FILTER('Table','Table'[Index]=EARLIER('Table'[Index])-1&&'Table'[Year-Month]=EARLIER('Table'[Year-Month])))

 

For the related .pbix file,pls click here.

 

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Thanks for answer, but I don't understand one thing, the column Index is equal the column device of the my table? If yes what the value to be showing with last value?

Hi @diegolima ,

 

Index column is similar to rank your rows ascending.So  the last value equals to the value of the row whose index refers to the current row index -1.

Is my result what you need?

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Greg_Deckler
Super User
Super User

Seems like you want LOOKUPVALUE or Lookup Min/Max here: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg for the answer, but I still don't understand how to solve my problem, I saw in the other post that you sent a question similar to my problem. I didn't see how to generate a column or measure to highlight the last parameter values ​​in the month.

 

Thank you so much!

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.