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
ShuchiSharma
Frequent Visitor

How to hide the future dates from the slicer conn

 

I have used a date table to connect the data from 2 different files and its working fine. However, when I publish and share the dashboard with other stakeholders, it's gets confusing from them till what date its showing the values. How can I hide the future dates from the slicer?

 

ShuchiSharma_1-1652335372001.png

 

On the other hand, if there is only 1 excel file and no date table, there is no such problem. 

Please guide!

Thanks

 

 

 

1 ACCEPTED SOLUTION

Hi @ShuchiSharma ,

Firstly, in your below formula, the position of the closing parenthesis of the MAX function is wrong, it should be 

D=CALENDAR(MAX('Date'[Date]),today())

vkalyjmsft_0-1652857409220.png

 

In your new Date table formula, you don't need to calculate the min and max year because the calendarauto function is calculated automatically based on data in the model. Modify it like this.

Date =
ADDCOLUMNS (
    FILTER ( CALENDARAUTO (), [Date] <= TODAY () ),
    "Calendar Year", "CY " & YEAR ( [Date] ),
    "Month Name", FORMAT ( [Date], "mmmm" ),
    "Month Number", MONTH ( [Date] )
)

This table will get your expected date period.

 

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

View solution in original post

7 REPLIES 7
ShuchiSharma
Frequent Visitor

Hi guys,

Still need help! Can anyone please help here with the above query? 

Thanks

ShuchiSharma
Frequent Visitor

Hi Shishir,

Thanks for the reply. I have tried but seems like doing it somewhere wrong. Can you please have a look?

ShuchiSharma_0-1652395665277.png

Using the below, I created the date table:

Date =
VAR MinYear = YEAR ( MIN ( 'Raised Data'[AddDateTime] ) )
VAR MaxYear = YEAR ( MAX ( 'Raised Data'[AddDateTime] ) )
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [Date] ) <= MaxYear )
),
"Calendar Year", "CY " & YEAR ( [Date] ),
"Month Name", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] )
)

And there are only three tables:

ShuchiSharma_1-1652395815975.png

Thanks 

 

Hi @ShuchiSharma ,

Firstly, in your below formula, the position of the closing parenthesis of the MAX function is wrong, it should be 

D=CALENDAR(MAX('Date'[Date]),today())

vkalyjmsft_0-1652857409220.png

 

In your new Date table formula, you don't need to calculate the min and max year because the calendarauto function is calculated automatically based on data in the model. Modify it like this.

Date =
ADDCOLUMNS (
    FILTER ( CALENDARAUTO (), [Date] <= TODAY () ),
    "Calendar Year", "CY " & YEAR ( [Date] ),
    "Month Name", FORMAT ( [Date], "mmmm" ),
    "Month Number", MONTH ( [Date] )
)

This table will get your expected date period.

 

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

Hi @v-yanjiang-msft Thank you so much. You saved me! Thanks again!

jaipal
Resolver III
Resolver III

@ShuchiSharma you can hide future dates by doing this 

jaipal_0-1652336800795.png

 

Thanks for the suggestion jaipal. However, this doesn't include the past dates. I need all the dates till today to compare the results. 

Shishir22
Solution Sage
Solution Sage

Hello @ShuchiSharma,

 

If you dont need to see future dates data, I would suggest remove it from your date dimension and your fact tables.

 

You can use Calendar(Max(date column from your fact table), today()) to get table with dates only till today

or

You can add a flag(Calculated column) in your date dimension and use it as a report/visual level filter.

Flag=if(DimDate[Date] <= Today(),1,Blank())

apply Flag=1 as a report/visual level filter.

 

Please mark it as answer if it solves your issue. Kudos are also appreciated..

 

 

Cheers,
Shishir

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.