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
santosonit
Frequent Visitor

How can I create a measure for matrix table that shows all months up to the max date selected?

Hello,

 

I am trying to have this visual show all values through the months of year until the month in the max date selected e.g. (if the date slicer has 09/01/2024 - 09/30/2024, then show all values from Jan through Sep.

This measure keeps showing values from 2023.

Note that Calendário[Date] filter pcprest[DTVENC].

TotalVALOR_YearMaxDate = 
CALCULATE(
    SUM(pcprest[VALOR]),
    FILTER(
        ALL('Calendário'[Date]),
        YEAR('Calendário'[Date]) = YEAR(MAX('Calendário'[Date])) && 
        'Calendário'[Date]<= MAX('Calendário'[Date])
    )
)

 Appreciate any help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @santosonit ,

 

According to your description, I have created two tables. There is no relationship between the two tables.

vkaiyuemsft_0-1728269016341.png

vkaiyuemsft_1-1728269055456.png

 

1. create measure.

MEASURE =
VAR _min_date =
MIN ( 'DAX DateTable'[Date] )
VAR _max_date =
MAX ( 'DAX DateTable'[Date] )
RETURN
IF (
YEAR ( MAX ( 'financials'[Date] ) ) = YEAR ( _max_date )
&& MAX ( 'financials'[Date] ) <= _max_date,

1
)

 

2. Drag it into the filter pane of the table's visual object to filter data with a value of 1.

vkaiyuemsft_2-1728269083829.png

 

3. create measure.

Measure2 =
CALCULATE (
SUM ( 'financials'[ Sales] ),
FILTER (
ALL ( 'financials' ),
YEAR ( 'financials'[Date] ) = YEAR ( MAX ( 'DAX DateTable'[Date] ) )
&& 'financials'[Date] <= MAX ( 'DAX DateTable'[Date] )
)
)

The final result is shown below.

vkaiyuemsft_3-1728269110775.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @santosonit ,

 

Have you already solved the problem? If so, can you share your solution here and mark the correct answer as standard to help other members find it faster? Thank you very much for your co-operation!

 

 

Best Regards,

Clara Gong

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

OktayPamuk80
Responsive Resident
Responsive Resident

Did you check my example? Did it help?

Anonymous
Not applicable

Hi @santosonit ,

 

According to your description, I have created two tables. There is no relationship between the two tables.

vkaiyuemsft_0-1728269016341.png

vkaiyuemsft_1-1728269055456.png

 

1. create measure.

MEASURE =
VAR _min_date =
MIN ( 'DAX DateTable'[Date] )
VAR _max_date =
MAX ( 'DAX DateTable'[Date] )
RETURN
IF (
YEAR ( MAX ( 'financials'[Date] ) ) = YEAR ( _max_date )
&& MAX ( 'financials'[Date] ) <= _max_date,

1
)

 

2. Drag it into the filter pane of the table's visual object to filter data with a value of 1.

vkaiyuemsft_2-1728269083829.png

 

3. create measure.

Measure2 =
CALCULATE (
SUM ( 'financials'[ Sales] ),
FILTER (
ALL ( 'financials' ),
YEAR ( 'financials'[Date] ) = YEAR ( MAX ( 'DAX DateTable'[Date] ) )
&& 'financials'[Date] <= MAX ( 'DAX DateTable'[Date] )
)
)

The final result is shown below.

vkaiyuemsft_3-1728269110775.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

OktayPamuk80
Responsive Resident
Responsive Resident

Hi, 

I have here a demo report with that example:

https://drive.google.com/drive/folders/1-1hilkkcjEjc451A7XMAVJtU701LqY3W?usp=sharing

Can you check, why I am getting the expected result and you don't? You can confirm whether it is the same situation.

Regards,
Oktay

Ashish_Mathur
Super User
Super User

Hi,

Try this measure pattern

Measure = calculate(sum(Data[Amount]),datesbetween(calendar[date],date(year(max(calendar[date])),1,1),max(calendar[date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
OktayPamuk80
Responsive Resident
Responsive Resident

Hi Santosonit,

Strange, so to check:

1) your calendar is connected to the pcprest table and is marked as date table (in table view select table and in the menubar there is the "mark as date table"

2) You didn't change the interactions (clicking on the slicer and under Format > Edit interactions you can configure so that the matric does not respond to the selected slicer)

3) Your requirement should also be achieved by using TotalYTD( sum(pcprest[VALOR], 'Calendario'[Date])

 

Regards,

Oktay

 

 

Did I answer your question? Then please mark my post as the solution.

If I helped you, click on the Thumbs Up to give Kudos.

Thanks for your attention and help, @OktayPamuk80 .

That didn't solve it though.

I have taken the steps above, but still...

I need the selected year's month values to show until the max date in the date picker/slicer.

 

Cheers,

Antonio

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.

Top Solution Authors