Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
**Problem resolved but post can't be deleted**
I'm having an issue with filtering values using variable dates.
Currently my formula is as follows:
Solved! Go to Solution.
I've actually managed to fix this!
Turns out I had a filter being applied via another slicer which was changing the date ranges and therefore not applying the assumed window.
Thanks anyway all!
Hi @Anonymous ,
Is this what you want?
COUNT(RawData[Ref])
when RawData[date] >= MinYear && RawData[date] <= MaxYears
Could you show me a sample data model? I need to know the relationship between 'RawData' table and 'Years' table.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I see you reference a non-existing variable (MinYearPost) in your return statement, that doesn't seem right?
Furthermore, what is the context this measure is evaluated in? is it part of a visual (and what visual)? For example; could it be there are multiple values in Year[Years] at time of evaluation and hence the SELECTEDVALUE() will not return anything?
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Proud to be a Super User!
Hi @Anonymous ,
Very weird, using your formula I can return the correct result.
Measure =
VAR x =
CALCULATE(
MIN(RawData[Date]),
FILTER(
RawData,
RawData[Type] = "after"
)
)
VAR y = x + [Years Value]*365
RETURN
CALCULATE(
COUNT(RawData[Ref]),
FILTER(
RawData,
[Date] >= x && [Date] <= y
)
)
(Fact table)
(What IF parameter)
Could you provide more information about the problem you have met?
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I've actually managed to fix this!
Turns out I had a filter being applied via another slicer which was changing the date ranges and therefore not applying the assumed window.
Thanks anyway all!
Hi @Anonymous ,
If your problem has been solved, please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Lionel Chen
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
62 | |
52 | |
39 | |
24 |
User | Count |
---|---|
84 | |
57 | |
45 | |
42 | |
37 |