March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
My report has a date/time field that shows the date/time of the first part confirmed for a shift.
I need to display a date/time in a Card that is the earliest time from the most recent date.
My data pulls from a dataflow several times a day and I'm trying to show the most recent data. However for this card I'm trying to show, essentially, at what time did we start making parts for a particular shift.
What I'm currently doing is: I have two card per shift - Earliest confirmation and latest confirmation (each that are flagged in another column as a "first piece confirmation"). I have the field set for the earliest one to show the earliest and the latest to show the latest.
My data for this page is filtered for the relative 2 days, including today.
The issue with this approach is: that the earlierst may show yesterday and the latest may show today (if data exists for today).
What I want is: If there is data for today to show the earliest and latest for it. If not, then show the earliest and latest for yesterday.
[FYI I am inable to share my report or data due to company policy.]
Edit: My data might take one of two forms:
Solved! Go to Solution.
Hi @Saw25 ,
You want two card visuals, one that shows today's latest time and one that shows today's earliest time. If there is no Today in the table, yesterday's is displayed.
Here're two measure for your reference. You can replace DATE(2023,7,12) with TODAY()
the latest time for recent date = var _today=DATE(2023,7,12)
var _date=MAX('Have data tody'[Date])
var _todaymax=MAXX(FILTER(ALLSELECTED('Have data tody'),[Date]=_today),[Date/Time])
var _yesterdaymax=MAXX(FILTER(ALLSELECTED('Have data tody'),[Date]=_today-1),[Date/Time])
var _if=IF(COUNTROWS(FILTER(ALLSELECTED('Have data tody'),[Date]=_today))>=1,_todaymax)
return _if
the earliest time for recent date = var _today=DATE(2023,7,12)
var _date=MAX('Have data tody'[Date])
var _todaymin=MINX(FILTER(ALLSELECTED('Have data tody'),[Date]=_today),[Date/Time])
var _yesterdaymin=MINX(FILTER(ALLSELECTED('Have data tody'),[Date]=_today-1),[Date/Time])
var _if=IF(COUNTROWS(FILTER(ALLSELECTED('Have data tody'),[Date]=_today))>=1,_todaymin,_yesterdaymin)
return _if
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you. I managed to come to almost the same solution. My code is a bit different but it seems to work well. Thank you.
Hi @Saw25 ,
You want two card visuals, one that shows today's latest time and one that shows today's earliest time. If there is no Today in the table, yesterday's is displayed.
Here're two measure for your reference. You can replace DATE(2023,7,12) with TODAY()
the latest time for recent date = var _today=DATE(2023,7,12)
var _date=MAX('Have data tody'[Date])
var _todaymax=MAXX(FILTER(ALLSELECTED('Have data tody'),[Date]=_today),[Date/Time])
var _yesterdaymax=MAXX(FILTER(ALLSELECTED('Have data tody'),[Date]=_today-1),[Date/Time])
var _if=IF(COUNTROWS(FILTER(ALLSELECTED('Have data tody'),[Date]=_today))>=1,_todaymax)
return _if
the earliest time for recent date = var _today=DATE(2023,7,12)
var _date=MAX('Have data tody'[Date])
var _todaymin=MINX(FILTER(ALLSELECTED('Have data tody'),[Date]=_today),[Date/Time])
var _yesterdaymin=MINX(FILTER(ALLSELECTED('Have data tody'),[Date]=_today-1),[Date/Time])
var _if=IF(COUNTROWS(FILTER(ALLSELECTED('Have data tody'),[Date]=_today))>=1,_todaymin,_yesterdaymin)
return _if
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you. I managed to come to almost the same solution. My code is a bit different but it seems to work well. Thank you.
Pode enviar uma amostra dos seus dados com informações ficticias, e exemplo do que deseja?
I updated my post to include a sample.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |