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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
natico
Frequent Visitor

I need the matrix to display the values ​​of the days equal to or less than the filtered day

I need to make a matrix in power bi similar to this table. If, for example, I filter the day Wednesday, the matrix should only display data for Monday, Tuesday and Wednesday.

 

It should look something like this:

natico_1-1696598788048.png

I was thinking of making a measure that would see the name of the day selected in the filter and assign the number that corresponds to that day of the week. And then compare that number with the number that would correspond to the day of the line. If it is less than or equal, it would bring in sales. If it is not, it must come blank.

 

Sales Pairs TY Report =
VAR NumDiaSeleccionado = MAX(D_DATES[day_week_number])
VAR SemanaSeleccionada = SELECTEDVALUE('D_DATES'[weekBATA])
VAR AnioSeleccionado = SELECTEDVALUE('D_DATES'[year])
RETURN
IF (
MAX(D_DATES[day_week_number]) <= NumDiaSeleccionado &&
MAX(D_DATES[weekBATA]) = SemanaSeleccionada &&
MAX(D_DATES[year]) = AnioSeleccionado,
[Sales Pairs TY],
BLANK()
)

 

But as you can see, the measure of the filtered day number does not work and takes the number of each row so it always meets the condition of being equal and brings data.

 

natico_2-1696598847819.png

 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @natico 

 

You can try the following methods.

Sample data:

vzhangti_0-1696906505431.png

Create a new slicer table:

Slicer = SUMMARIZE(D_DATES,D_DATES[Name],D_DATES[Weekday])

vzhangti_1-1696906549147.png

Measure = IF(SELECTEDVALUE(D_DATES[Weekday])>SELECTEDVALUE(Slicer[Weekday]),BLANK(),SUM(D_DATES[Sales]))

vzhangti_2-1696906632696.png

Is this the result you expected? Please refer to the attachment.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @natico 

 

You can try the following methods.

Sample data:

vzhangti_0-1696906505431.png

Create a new slicer table:

Slicer = SUMMARIZE(D_DATES,D_DATES[Name],D_DATES[Weekday])

vzhangti_1-1696906549147.png

Measure = IF(SELECTEDVALUE(D_DATES[Weekday])>SELECTEDVALUE(Slicer[Weekday]),BLANK(),SUM(D_DATES[Sales]))

vzhangti_2-1696906632696.png

Is this the result you expected? Please refer to the attachment.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

BeaBF
Super User
Super User

@natico Hi! Try with this adjusted measures:


FIRST:

SelectedDayNumber = SELECTEDVALUE('D_DATES'[day_week_number])
SECOND:

Sales Pairs TY Report =
VAR SelectedDayNumber = [SelectedDayNumber]
VAR DayOfWeekNumber = SELECTEDVALUE('D_DATES'[day_week_number])
VAR SemanaSeleccionada = SELECTEDVALUE('D_DATES'[weekBATA])
VAR AnioSeleccionado = SELECTEDVALUE('D_DATES'[year])

RETURN
IF (
DayOfWeekNumber <= SelectedDayNumber &&
MAX(D_DATES[weekBATA]) = SemanaSeleccionada &&
MAX(D_DATES[year]) = AnioSeleccionado,
[Sales Pairs TY],
BLANK()
)

BBF

Greg_Deckler
Community Champion
Community Champion

@natico See if this helps: https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M5...

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.