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
b2wise
Helper III
Helper III

Filter Date Slicer To Only Show Months With Full Data

Hi All,

 

I have a dataset where three of my tables are excel tables that I have to update manually. I want to filter the date slicer visual (Month&Year) on the report page to only allow selections of months when the data is complete for that month.

 

In other words if the max date of any of the 3 tables is in September 2021 only allow to select up to August 2021 because the data for September isn't complete.

 

Here is an example of my three tables:

 

Temp Hours

DateHours
09/05/202136.00
10/07/201835.00
10/14/201826.00

 

Punch_Report

DATETOTAL
9/25/20211.5
9/24/20215.32
9/23/20215.82

 

Warehouse Errors: (Max of any of the date fields, if this is too hard my relationship is to 'Date of Occurence' so can just use that one)

Date of OccurenceItemDate CreatedDate ClosedLast Modified
6/19/2019 14:171-ABC6/30/2021 11:146/30/2021 12:149/30/2021 12:14
7/19/2019 0:002-CDE7/31/2019 14:408/1/2019 18:058/17/2020 13:34
10/15/2019 0:003-EFG12/18/2019 12:5412/19/2019 18:1712/19/2019 18:17

 

Date Table (Just 2 of my many columns in the date table. I use this one)

DateMonth & Year
8/3/2021Aug 2021
9/7/2021Sep 2021
10/5/2021Oct 2021

 

My dataset is already slow so I would appreciate any quick performing DAX rather than calculated columns.

 

Thanks in advance!

 

3 REPLIES 3
b2wise
Helper III
Helper III

@b2wise I tried this formula, and set a visual level filter as greater than 0 but it's not working

 

Date Slicer Limiter =
--Limit date slicer to previous month from latest month date
VAR maxpunchdate =
    MAX ( Punch_Report[DATE] )
VAR maxtemphours =
    MAX ( 'Temp Hours'[Invoice Date] )
VAR minmonth =
    MONTH ( MIN ( maxpunchdate, maxtemphours ) )
VAR minyear =
    YEAR ( MIN ( maxpunchdate, maxtemphours ) )
RETURN
    CALCULATE (
        COUNTROWS ( Dates ),
        YEAR ( Dates[Date] )
            && MONTH ( Dates[Date] ) < YEAR ( minyear )
            && MONTH ( minmonth )
    )

lbendlin
Super User
Super User

"when the data is complete for that month"

 

How do you decide that?  Based on the presence of data for the next month?

@lbendlin Yes, I know it's not perfect but it should work given that these tables have a new entry almost every day.

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