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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Calculate MTD based of Weeks passed in the month

Hi everyone,

 

I would like to calculated running MTD based on the week number.

Here is my table data:

adriandumitru_0-1660309822030.png

So I would like a dax measure to calculate from the begining of the month ( now is august, week 31), until the last week in the month (today would be week 33, next week until week 34).

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pibx file.

It is for creating a measure.

 

Picture2.png

 

expected measure: =
IF (
    HASONEVALUE ( Data[Week] ),
    CALCULATE (
        SUM ( Data[Weight] ),
        FILTER (
            ALL ( Data ),
            Data[Year] = MAX ( Data[Year] )
                && Data[Month] = MAX ( Data[Month] )
                && Data[Week] <= MAX ( Data[Week] )
        )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Thank you @Jihwan_Kim 

Is working, but not as I want. It was my mistake to not write all the details.

I've added a date column in the table. Date(Year,Month, 1), the table beeing connected to a date table.

The report will be MTD filtered and I want the formula to work in a Card graph.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.