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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
k1s2
Helper I
Helper I

Why isn't isn't my Month to Date column working?

Hi, I'm trying to get a column with a running total each month using this DAX in the column:

MTD Risks =
 CALCULATE(
    SUM(q_Compliance[Some Current Risk]),
    DATESMTD('Calendar'[Date]),
    USERELATIONSHIP(q_Compliance[Risk Assessment Date],'Calendar'[Date])
 )

...but I just get blanks in the colum:

Screenshot 2024-01-06 115817.jpg

What am I doing wrong?

 

 

 

1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

hi, @k1s2 

i think below code is useful for your requirnment

MTD Risks = 
CALCULATE(
    SUM(q_Compliance[Some Current Risk]),
   DATESMTD(q_Compliance[Risk Assessment Date]),
   ALLEXCEPT('q_Compliance',q_Compliance[Risk Assessment Date])
)

Dangar332_0-1704547808898.png

 

View solution in original post

3 REPLIES 3
Dangar332
Super User
Super User

hi, @k1s2 

i think below code is useful for your requirnment

MTD Risks = 
CALCULATE(
    SUM(q_Compliance[Some Current Risk]),
   DATESMTD(q_Compliance[Risk Assessment Date]),
   ALLEXCEPT('q_Compliance',q_Compliance[Risk Assessment Date])
)

Dangar332_0-1704547808898.png

 

Thank you.  DO you have time to explain why it needs the ALLEXCEPT part? 

 

It seems counterintiutive. Surely I want it to include those dates?

k1s2
Helper I
Helper I

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.