The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, im making a birtday dashboard for my company.
I think ive gotten it to work. My only issue is that if there is no birthday today the displayed information is just "has birthday today!".
I'd love to make it so the text displays "No one has birthday today" when there is no birthday at todays date.
This is how the text looks when there is no birthday that day:
Here is the DAX, some of the text is in Norwegian:
Solved! Go to Solution.
Hey @Anonymous try this:
Not sure if _result return blank when there are no birthdays, so if not I'll change the code a little bit
Whos birthday is it today? =
VAR next =
MINX (
FILTER (
Table1,
MONTH ( Table1[Nextbirthday] ) = MONTH ( TODAY () )
&& DAY ( Table1[Nextbirthday] ) = DAY ( TODAY () )
),
CALCULATE (
DATE ( YEAR ( TODAY () ), MONTH ( MIN ( Ark1[Nextbirthday] ) ), DAY ( MIN ( Ark1[Nextbirthday] ) ) )
)
)
VAR _result =
CONCATENATEX (
FILTER (
Table1,
MONTH ( Table1[Nextbirthday] ) = MONTH ( next )
&& DAY ( Ark1[Nextbirthday] ) = DAY ( next )
),
FIRSTNONBLANK ( Table1[Name], 1 ),
" & "
)
RETURN
IF (
NOT ISBLANK ( _result ),
_result & " has their birthday today!",
"No one has birthday today"
)
Hi @Anonymous ,
I ithink they meant like this. Try it :
Hvem har bursdag i dag? = VAR next = MINX(
FILTER(
Ark1,
MONTH(Ark1[NesteBursdag]) = MONTH(TODAY()) &&
DAY(Ark1[NesteBursdag]) = DAY(TODAY())
),
CALCULATE(
DATE(
YEAR(TODAY()),
MONTH(MIN(Ark1[NesteBursdag])),
DAY(MIN(Ark1[NesteBursdag]))
)
)
)
var _result = CONCATENATEX(
FILTER(
Ark1,
MONTH(Ark1[NesteBursdag]) = MONTH(next) &&
DAY(Ark1[NesteBursdag]) = DAY(next)
),
FIRSTNONBLANK(Ark1[Navn], 1),
" & "
)
RETURN
IF(ISBLANK(_result),"No one has birthday today.",_result & " har bursdag!")
Regards
@Anonymous
Hey, hard with the language 🙂 but hopefully you can adjust this logic to your VAR/Measure names needed:
change the last RETURN to VAR named "result" and then:
RETURN
IF( NOT ISBLANK(Birthday), _result, "No one has birthday today")
Hey @Anonymous try this:
Not sure if _result return blank when there are no birthdays, so if not I'll change the code a little bit
Whos birthday is it today? =
VAR next =
MINX (
FILTER (
Table1,
MONTH ( Table1[Nextbirthday] ) = MONTH ( TODAY () )
&& DAY ( Table1[Nextbirthday] ) = DAY ( TODAY () )
),
CALCULATE (
DATE ( YEAR ( TODAY () ), MONTH ( MIN ( Ark1[Nextbirthday] ) ), DAY ( MIN ( Ark1[Nextbirthday] ) ) )
)
)
VAR _result =
CONCATENATEX (
FILTER (
Table1,
MONTH ( Table1[Nextbirthday] ) = MONTH ( next )
&& DAY ( Ark1[Nextbirthday] ) = DAY ( next )
),
FIRSTNONBLANK ( Table1[Name], 1 ),
" & "
)
RETURN
IF (
NOT ISBLANK ( _result ),
_result & " has their birthday today!",
"No one has birthday today"
)
Thanks! It worked like a charm!
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
20 | |
15 | |
14 | |
10 | |
7 |