Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
60 | |
57 |