Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear All,
I am working on Attendance report in Power BI , below DAX is working fine for "P" & "WO" , but the moment i add "A" in else part of Switch, it return entire year value in table , instead of selected month from Slicer ,Any suggestion or advice much appreciate, Thank you ,
_Attendance = SWITCH(TRUE(),
COUNTROWS(FILTER(Sheet2 , Sheet2[Login Date] >= RELATED('Calendar'[Date] ) )) = 1,"P",
FORMAT(SELECTEDVALUE('Calendar'[Date]),"DDD") = "Fri" || FORMAT( SELECTEDVALUE('Calendar'[Date]),"DDD")= "Sat", "WO")
Thank you for your reply,
ihave little modified DAX : SWITCH to IF , and as suggested instead of A , i have used
so with this change , 2 things are fixed, one now its only showing selected month date, and instead of blank its is now showing "A",
:>>>
now there one thing which is slight concern, for future date it is also showing "A", where for for future date it is expected as Blank
Does it help if you use SELECTEDVALUE ( 'Calendar'[Date], "A" ) instead of "A" for the else default value?
This should still return blanks when the date is outside of your selected range.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |