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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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)

 


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors