Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Slicer using DimDate do not ge filtered based on Fact

I have created DimDate with calculated colums. I have report with Stacked Column chart, Year slicer and WeekNum slicer.

 

I have now difficulties to use DimDate as slicer. I have data from only 2019 in fact table which have been connected to DimDate. DimDate covers 2019-2013 dates.

However my slicers for Year and WeekNum shows every single rows that exists in DimDate. How to configure slicer and relationship so that Slicer get only values that includes data in Fact.

 

PowerBI_Slicer problem.png

6 REPLIES 6
Anonymous
Not applicable

Hi , 

Create your date dimesion with below DAX.

 

DateTable =
ADDCOLUMNS (
CALENDARAUTO(),
"Year", YEAR ( [Date] ),
"QuarterOfYear", FORMAT ( [Date], "Q" ),
"MonthOfYear", FORMAT ( [Date], "MM" ),
"DateInt", FORMAT ( [Date], "YYYYMMDD" ),
"MonthName", FORMAT ( [Date], "mmmm" ),
"MonthInCalendar", FORMAT ( [Date], "mmm YYYY" ),
"QuarterInCalendar", "Q" & FORMAT ( [Date], "Q" ) & " " & FORMAT ( [Date], "YYYY" ),
"DayInWeek", WEEKDAY ( [Date] ),
"DayOfWeekName", FORMAT ( [Date], "dddd" ),
"DayOfWeekShort", FORMAT ( [Date], "ddd" ),
"YearMonthShort", FORMAT ( [Date], "YYYY/mmm" ),
"MonthNameShort", FORMAT ( [Date], "mmm" ))




Best Regards,
Mail2inba4


If this post helps, then please consider Accept it as the solution to help the other members find easily

Anonymous
Not applicable

Seems to work. Thanks.  How to add Week Number to the script? (1-52)

=weeknum(Table[Datecolumn])

Don't forget to hit Thumbs up and mark it as a solution if it helps you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

WeekNum Slicer did not work correctly. It showed all possible values without filter to Fact.

 

I did added Calculated Column with DAX: WeekNum =weeknum(Table[Datecolumn]) to same table, which have been created with Advanced Editor.

 

I wonder if it is possible to add week number inside script in Advanced Editor.

Tahreem24
Super User
Super User

Change the relationship cardinality to one to many and cross filter direction to both.

Please hit Thumbs up for support and accept this as a solution if it helps you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

I tried "many to one" with "both" and "one to many" with "both". No positive effect to slicers.

PowerBI_Slicer problem2.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.