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
More equipment is listed in the equipment column, which I filter out to make sense of.
The result should be like this:
Solved! Go to Solution.
@aslam-ansari
My mistake again
End Date =
VAR CurrentDate = 'Table'[Start Date]
VAR CurrentEquipmentDates =
CALCULATETABLE (
VALUES ( 'Table'[Start Date] ),
ALLEXCEPT ( 'Table', 'Table'[Equipment] )
)
VAR NextDate =
MINX (
FILTER ( CurrentEquipmentDates, 'Table'[Start Date] > CurrentDate ),
'Table'[Start Date]
)
RETURN
IF ( NextDate = BLANK (), TODAY (), NextDate - 1 )
hai @tamerj1
Getting error.
My actual table looks like this.
In that scenario, take into account time. Some equipment status changes even occur on the same date. The end date in these circumstances should be the same date up to 3:11:06 PM, and thereafter it should be TODAY().
@aslam-ansari
Apologies, That was a typo mistake. I was typing on the phone so I miussed up. Please try
End Date =
VAR CurrentDate = 'Table'[Start Date]
VAR CurrentEquipmentDates =
CALCULATETABLE (
VALUES ( 'Table'[Start Date] ),
ALLEXCEPT ( 'Table', 'Table'[Equipment] )
)
VAR NextDate =
MAXX (
FILTER ( CurrentEquipmentDates, 'Table'[Start Date] > CurrentDate ),
'Table'[Start Date]
)
RETURN
IF ( NextDate = BLANK (), TODAY (), NextDate - 1 )
Thank you for the solution @tamerj1
Something missing in Dax!
After the first-row same-date return on all dates, the equation still needs to be changed. This only applies to one piece of equipment. Every piece of equipment has this issue.
@aslam-ansari
My mistake again
End Date =
VAR CurrentDate = 'Table'[Start Date]
VAR CurrentEquipmentDates =
CALCULATETABLE (
VALUES ( 'Table'[Start Date] ),
ALLEXCEPT ( 'Table', 'Table'[Equipment] )
)
VAR NextDate =
MINX (
FILTER ( CurrentEquipmentDates, 'Table'[Start Date] > CurrentDate ),
'Table'[Start Date]
)
RETURN
IF ( NextDate = BLANK (), TODAY (), NextDate - 1 )
please try
End Date =
VAR CurrentDate = 'Table'[Start Date]
VAR CurrentEquipmentDates =
CALCULATETABLE (
VALUES ( 'Table'[Start Date] ),
ALLEXCEPT ( 'Table', 'Table'[Equipment] )
)
VAR NextDate =
MAXX (
FILTER ( CurrentEquipmentDates, CurrentEquipmentDates > CurrentDate ),
CurrentEquipmentDates
)
RETURN
IF ( NextDate = BLANK (), TODAY (), NextDate - 1 )
User | Count |
---|---|
21 | |
14 | |
11 | |
8 | |
5 |
User | Count |
---|---|
24 | |
21 | |
20 | |
15 | |
10 |