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
Rahul_Bhatt
Helper I
Helper I

Calendar Dates are not Filtering as per dates

I am using  calender command which makes a calendar as per min date and max date, but this calander is filtering as per role Mention in  power bi ,

 

I have a data which related to multiple property and in which  , property "A" started in 2011 and second property "B" started in 2013 to til now , I have set a role according to property A and B,

 

I want when i select Property A Calender year and dates should be starts from 2011 and When select B calender year should be start from 2013. Please find the below code which i am to make calender table .

 

Date =
ADDCOLUMNS (
CALENDAR (
DATE ( YEAR ( MIN ( Table1[Check Date] ) ), 1, 1 ),
DATE ( YEAR ( MAX ( Table1[Check Date] ) ), 12, 31 )
),
"Year",INT(FORMAT ( [Date], "YYYY" )),
"Month Number", INT ( FORMAT ( [Date], "MM" ) ),
"Month Name", FORMAT ( [Date], "MMM" ),
"Month Full Name", FORMAT ( [Date], "MMMM" ),
"Quarter", "Q" & INT ( FORMAT ( [Date], "Q" ) ),
"Week Day Number", INT ( WEEKDAY ( [Date],2 ) ),
"Week Day", FORMAT ( [Date], "DDDD" ),
"Year Month ",FORMAT ( [Date], "MMM" ) & " " & YEAR ( [Date] )

)

 

Below screen shot showing data which is coming after setting the role and but year is not filetring as per Table1 date for Property it still starts form 2011 wheree as property B dtata starts from 2013.

 

 

 

 

 

123.jpg

111.png 

 

 

 

 

1 REPLY 1

You cannot change a table calculation based on a role. Instead, build the max calendar table you need.  You could probably filter it using a suitable measure against a slicer on the calendar table



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

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.

Top Solution Authors