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
Hi all,
I was kindly given this DAX formula for an issue I have returning available date based on description/bay and start date.
It works really well, unfortunately it returns a value stated above for certain Bays.
What I would like to do is instead of the date I would like it to say "Bay Booked Out for Week".
DAX is Below.
Thanks
Solved! Go to Solution.
Hi @villa1980 , Please check the below measure:
Min_Date =
VAR _Centre = SELECTEDVALUE(Next_Available_Date[Centre Name])
VAR _Bay = SELECTEDVALUE(Next_Available_Date[BAYDESC])
VAR _Date = SELECTEDVALUE(Next_Available_Date[STARTDATE])
VAR _Minute = SELECTEDVALUE(Next_Available_Date[Available_Minutes])
VAR _MinimumDate = MINX(FILTER(ALLSELECTED(Next_Available_Date), Next_Available_Date[BAYDESC] = _Bay), Next_Available_Date[STARTDATE])
RETURN
IF (
CALCULATE(
MAX(Next_Available_Date[Available_Minutes]),
FILTER(Next_Available_Date, Next_Available_Date[BAYDESC] = _Bay && Next_Available_Date[STARTDATE] = _MinimumDate)
) = 0 &&
CALCULATE(
MAX(Next_Available_Date[Available_Minutes]),
FILTER(Next_Available_Date, Next_Available_Date[BAYDESC] = _Bay && Next_Available_Date[STARTDATE] = _Date)
) = 0,
"Bay Booked Out for Week",
IF (
_Minute = 0 && _Date > _MinimumDate && (_Minute > 1 || _Minute < 540),
_MinimumDate,
IF (
_Minute = 0,
_Date + 1,
_MinimumDate
)
)
)
Hi @villa1980 , Please check the below measure:
Min_Date =
VAR _Centre = SELECTEDVALUE(Next_Available_Date[Centre Name])
VAR _Bay = SELECTEDVALUE(Next_Available_Date[BAYDESC])
VAR _Date = SELECTEDVALUE(Next_Available_Date[STARTDATE])
VAR _Minute = SELECTEDVALUE(Next_Available_Date[Available_Minutes])
VAR _MinimumDate = MINX(FILTER(ALLSELECTED(Next_Available_Date), Next_Available_Date[BAYDESC] = _Bay), Next_Available_Date[STARTDATE])
RETURN
IF (
CALCULATE(
MAX(Next_Available_Date[Available_Minutes]),
FILTER(Next_Available_Date, Next_Available_Date[BAYDESC] = _Bay && Next_Available_Date[STARTDATE] = _MinimumDate)
) = 0 &&
CALCULATE(
MAX(Next_Available_Date[Available_Minutes]),
FILTER(Next_Available_Date, Next_Available_Date[BAYDESC] = _Bay && Next_Available_Date[STARTDATE] = _Date)
) = 0,
"Bay Booked Out for Week",
IF (
_Minute = 0 && _Date > _MinimumDate && (_Minute > 1 || _Minute < 540),
_MinimumDate,
IF (
_Minute = 0,
_Date + 1,
_MinimumDate
)
)
)
Hi @villa1980
Please provide a workable sample data and your expected result from that. It is hard to figure out what you want to achieve from the description alone.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |