Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello all,
I have a Calendar table and a 'Product' table with columns: Product, Date, Price, etc. The 2 tables have NO relationship.
In the Report View, I have a slicer on the Calendar table.
I also have 2 date-related measures to help me look at a 2-month period:
Min Date = max('Calendar'[date])
Max Date = EOMONTH([Min Date], 2)
In this setting, if I choose 1 Oct 2024 in the slicer, then Min Date = 1 Oct 2024; Max Date = 31 Dec 2024.
Now I have a bar chart with x-axis = Product and y-axis = Price. I want the chart to show only data in the period I choose so I have made below measure:
Flag_within period = IF(MIN('Product'[Date]) >= [Min Date] && MAX('Product'[Date]) <= [Max Date], 1, 0)
And I have applied this measure as a visual level filter to the bar chart and choose "is 1". Then the bar chart becomes blank even there should be data. If I choose 0, it shows all data back.
Please could anyone tell me what's wrong with my flag measure? Thank you!
(Sorry that I cannot share any data as this is company computer)
Hi @superhayan
Are you sure that all your sales data is between these two dates?! it seems that it is not, so that you see blank.
you need to update your measure as follows:
Flag_within period = IF(selectedvalue('Product'[Date]) >= [Min Date] && selectedvalue('Product'[Date]) <= [Max Date], 1, 0)
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.
Sorry that it still doesn't work. The chart goes blank after I selected the filter to 1.
The sales data is from Oct 2024 to Sep 2025 so it is within the period I choose.
now, I see that you have written "Min Date = max('Calendar'[date])" in your code. why did you write max instead of min?! the problem may happened because of that! if not please share some details
Hi @superhayan
Thanks for the reply from @Selva-Salimi .
@superhayan , the following testing is for your reference.
My sample:
Product table:
Calendar Table:
Create a measure as follows
Measure =
VAR _MinDate = SELECTEDVALUE('Calendar'[date])
VAR _MaxDate = EOMONTH(_MinDate, 2)
RETURN
IF(SELECTEDVALUE('Calendar'[Date]) = BLANK(), 1, IF(SELECTEDVALUE('Product'[Date]) > _MinDate && SELECTEDVALUE('Product'[Date]) < _MaxDate, 1, 0))
Put the measure into the visual-level filters, set up show items when the value is 1.
Output:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |