Forum Discussion
Slicer issue with weekend date selection
- 1 year ago
Thankyou, GrowthNatives, for your response.
Hi anonymous2967,We appreciate your inquiry posted on the Microsoft Fabric Community Forum.
Kindly find attached the screenshot and the PBIX file, which may assist in resolving the issue:
If you find our response helpful, please consider marking it as the accepted solution and kindly provide kudos. This will help other community members who may have similar queries.
Thank you.
Hi anonymous2967 ,
I understand that you are facing a slicer issue with weekend date selection, to the best of my understanding, the issue you're facing is due to how the slicer reacts when weekend dates (which might not have data) are selected, even though users have KPI targets within that month.
The DAX solution I am sharing should help. However, since I havenβt seen your actual Power BI file and data structure, it would be much better if you could provide access via Google Drive. That way, I can review it more accurately.
π Assuming:
KPI table includes columns: UserID, Date, Target
Users table includes: UserID, UserName
Date table includes: Date, Month, Day, IsWeekend (optional)
Relationship:
KPI[Date] β Date[Date]
KPI[UserID] β Users[UserID]
Contact is not directly relevant unless it filters users
β Calculated Table DAX Solution (for Slicer):
Create a new table for slicer that only includes users with a target in the selected month:
UsersWithMonthlyTarget =
VAR SelectedMonth =
SELECTEDVALUE('Date'[Month]) -- or use MonthNumber or Month-Year as needed
RETURN
FILTER (
Users,
CALCULATE (
COUNTROWS (KPI),
FILTER (
KPI,
MONTH (KPI[Date]) = SelectedMonth
&& NOT ISBLANK(KPI[Target])
)
) > 0
)This ensures that only users with a KPI target in the selected month will show in the slicer, even if a weekend date is selected.
π‘ Alternative (If Using Measure Instead in Visual):
If you want to keep your existing slicer but make usernames appear even when weekends are selected, you can modify the filtering behavior using a measure like:
HasTargetThisMonth =
CALCULATE (
COUNTROWS (KPI),
FILTER (
KPI,
MONTH (KPI[Date]) = MONTH(SELECTEDVALUE('Date'[Date]))
&& NOT ISBLANK(KPI[Target])
)
)Then filter the slicer using a visual-level filter: HasTargetThisMonth > 0
Notes:
This won't require any change to the underlying data model or relationships.
Works dynamically with your existing slicers for date/month.
If your Date table has Month-Year, use that for better precision (not just month number).
βHope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
π‘Found it helpful? Show some love with kudos π as your support keeps our community thriving!
πLetβs keep building smarter, data-driven solutions together! π
- anonymous29671 year agoRegular Visitor
Hi, Thanks for the prompt reply. I have now attached model and relationship screenshots.
Also provided sample files with download permission to the google drive link. Could you please check and let me know.
https://drive.google.com/drive/folders/1BFTfeAel32M9AnVJcc7iwleTdqcd_gzr?usp=drive_link
- anonymous29671 year agoRegular Visitor
GrowthNatives are you able to access the folder and do you have any solution for this .
- anonymous29671 year agoRegular Visitor
Thanks for the prompt reply. I have tried the above solutions provided , however it didnt work.
Sorry I have now provided the required access to download the sample pbix file and source files to view the datamodel. Looking forward for your response.
https://drive.google.com/drive/folders/1BFTfeAel32M9AnVJcc7iwleTdqcd_gzr?usp=drive_link