The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
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?
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
9 | |
8 |