Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |