Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello everyone i am building a matrix table and need to add dynamic filter to see the required dates,
if i use a normal table visual i get the correct filters and dates needed
however if i turn it into a matrix and try the same filter, i get blank
the measure i am using
Week check =
VAR ReferenceDate =
CALCULATE(MAX( dimDate[StartOfWeek] ), REMOVEFILTERS(dimDate))
VAR NumDays =
SELECTEDVALUE ( Parameter[Parameter] ) * 7
RETURN
IF ( ( ReferenceDate - NumDays ) <= SELECTEDVALUE(dimDate[StartOfWeek]), 1 )
any help is appreciated!
Solved! Go to Solution.
Hi @eliasayyy,
Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to @grazitti_sapna, for his inputs on this thread. I reproduced the scenario, and it worked on my end. I used my sample data and successfully implemented it.
I am also including .pbix file for your better understanding, please have a look into it.
Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.
Thank you for using the Microsoft Fabric Community Forum.
Hi @eliasayyy,
Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to @grazitti_sapna, for his inputs on this thread. I reproduced the scenario, and it worked on my end. I used my sample data and successfully implemented it.
I am also including .pbix file for your better understanding, please have a look into it.
Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.
Thank you for using the Microsoft Fabric Community Forum.
Hi @eliasayyy,
Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.
Thank you.
Hi @eliasayyy,
Just wanted to follow up one last time. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.
Thank you.
Hi @eliasayyy,
Try below DAX
WeekCheck =
VAR ReferenceDate =
CALCULATE(MAX(dimDate[StartOfWeek]), REMOVEFILTERS(dimDate))
VAR NumDays =
MAX(Parameter[Parameter]) * 7
VAR CurrentDate = MAX(dimDate[StartOfWeek])
VAR StartDate = ReferenceDate - NumDays
RETURN
IF(
CurrentDate >= StartDate &&
CurrentDate <= ReferenceDate,
1,
0
)
hmm seems to be removing some of my weekdays now, and still showing date starting jun 2, whats weird is if i change the measure to say show me everything before and not after so change it from <= to >=, the logic works but i have no clue why its reacting this way
Use below DAX
WeekCheck =
VAR ReferenceDate =
CALCULATE(
MAX(dimDate[StartOfWeek]),
REMOVEFILTERS(dimDate)
)
VAR NumDays =
SELECTEDVALUE(Parameter[Parameter]) * 7
VAR StartDate =
ReferenceDate - NumDays
VAR CurrentDate =
MAX(dimDate[StartOfWeek])
RETURN
IF(
CurrentDate >= StartDate &&
CurrentDate <= ReferenceDate,
1,
0
)
and check below
Sort StartOfWeek ascending
Ensure dimDate granularity and relationships are correct
hello @grazitti_sapna , still n oavail, i added the measure on the matrix table
as you see, it showing 1 correctly in the dates needed but no idea why its not abiding by the filter
Hi @eliasayyy,
Matrix and table visuals work differenctly
Table visual – Each row has a single context. Your SELECTEDVALUE(dimDate[StartOfWeek]) works because only one date exists in the current row context.
Matrix visual – Rows and columns create a multi-dimensional context. In a cell, SELECTEDVALUE often cannot resolve to a single value, so it returns BLANK.
This is why your matrix shows blank.
To Fix this create below measure
WeekCheck =
VAR ReferenceDate =
CALCULATE(MAX(dimDate[StartOfWeek]), REMOVEFILTERS(dimDate))
VAR NumDays =
MAX(Parameter[Parameter]) * 7
VAR CurrentDate = MAX(dimDate[StartOfWeek])
RETURN
IF((ReferenceDate - NumDays) <= CurrentDate, 1, 0)
Now drag this measure to filter pane of matrix visual and set filter to 1.
This should fix your issue.
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
hey @grazitti_sapna ! thank you for replying, i tried the measure but i got a weird result:
i got results from june 2 until october 6 which is weird because my parameter is only set to 3 so should be from septemebr 15 until october 6, any idea why?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.