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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
kendall
Helper I
Helper I

Creating a New Measure based on MTD or YTD

Hello, 

Below are photos for a problem. How could I count a running total for the Number of Surveys received a) month to date and b) year to date? I have tried the code below but it is not working:

 

Better RT =
    VAR __Date = MAX('All survey data'[Month])
    VAR __Table = FILTER(ALLSELECTED('All survey data'[Month]),<= 'All survey data'[Month])
RETURN
    SUMX('All survey data','All survey data'[Counted Survey Number])
 

 

Screenshot (67).pngScreenshot (68).pngScreenshot (69).pngScreenshot (70).png

3 REPLIES 3
kendall
Helper I
Helper I

If I send you the data, would you be able to tell me the formula? Thanks. Basically a count of surveys received for month to date and year to date based on this source data in Excel

Screenshot (73).pngScreenshot (74).png

 

 

Any thoughts on this? Thanks 

Greg_Deckler
Super User
Super User

@kendall Hard to tell what is going on without sample data and more formulas but try this:

 

Better RT =
    VAR __Date = MAX('All survey data'[Date])
    VAR __Table = FILTER(ALLSELECTED('All survey data'), [Date] <= __Date)
RETURN
    COUNTROWS(__Table)

 



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.