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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Katarina
New Member

Measure dosen't work with date hierarhy

Hi ! 

Task : I need to filter the visualization table. Show records whose creation date falls within the date range from the slicer.
need to use date hierarchy in slicer (screenshot attached). it should be possible to select the year, apartment, month, week 

I have a date dimension table that has no links to a records table. so I'm trying to create a measure that will help filter the records.
I managed to filter using slicer "between" without hierarchy date. 

1. How slicer should look like:

Katarina_0-1688138689730.png


2. Code which i try to make it work : 

MAX_DATE = 
VAR year_max =
  MAX(  VW_DIM_DATE[YEAR])
VAR month_max =
  MAX( VW_DIM_DATE[MONTH_ID])
VAR day_max=
    MAX( VW_DIM_DATE[DAY_OF_MONTH] )
RETURN
    DATE ( year_max,month_max,day_max )
MIN_DATE = 
VAR year_min =
  Min(  VW_DIM_DATE[YEAR])
VAR month_min =
  Min( VW_DIM_DATE[MONTH_ID])
VAR day_min=
    Min( VW_DIM_DATE[DAY_OF_MONTH] )
RETURN
     DATE ( year_min,month_min,day_min )
_NonClassificationSitesInDateRange1 = 
CALCULATE(
    DISTINCTCOUNT(VW_DIM_SITES[EXISTING_RESOURCE_ID]),
 DATESBETWEEN(
        VW_DIM_SITES[SITE_CREATION_DT],  
     [MIN_DATE],  
       [MAX_DATE]
    )
)

The last measure was put in table, but it doesn't work correctly.
I have creation date from 2015 to 2023 years but it works only when the date range includes 2023 year. 
Could you please help me with this issue or suggest any other solutions? 



0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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