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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
GeekAlfPro
Helper V
Helper V

look up or filter data

Hello,

 

i have a table with several equipments.

i want to get the first and the last value of the day for one equipment

in the following table the green and orange value.

GeekAlfPro_0-1646330294172.png

but i'm struggling with the dax formulas.

i tried

M_soc_depart = 
var _heure = minx(ALLSELECTED('table'), 'table'[timestamp])
return
CALCULATE(MAX('table'[value], FILTER('table', 'table'[timestamp] = _heure)))

 but it doesn't work, pbi says that i have several values....

 

any help would be welcome.

1 ACCEPTED SOLUTION

I finally manage to get what i want

by using firstnonblankvalue and lastnonblankvalue.

 

thanks !

View solution in original post

3 REPLIES 3
tackytechtom
Super User
Super User

Hi @GeekAlfPro ,

 

I have a solution here:

tomfox_0-1646336683448.png


And these are the measure in DAX:

TomsMaxMeasure = 
CALCULATE ( 
    MAX ( Table5[value]  ),
    ALLEXCEPT ( table5, Table5[id_equipment], Table5[timestamp] )
)
TomsMinMeasure = 
CALCULATE ( 
    MIN ( Table5[value]  ),
    ALLEXCEPT ( table5, Table5[id_equipment], Table5[timestamp] )
)


Does this solve your issue? 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Hello @tackytechtom ,

 

thanks for your response.

unfortunately, et because i wasn't explicite enough, it not exactly the solution.

i have outliers, that's why i want to get the first data of the day and the last one

 

GeekAlfPro_0-1646391978580.png

your formulas give me the min and max of the values.

i want the values associated with the min / max of timestamp.

i hope i'm clear enough

I finally manage to get what i want

by using firstnonblankvalue and lastnonblankvalue.

 

thanks !

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.