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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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

Top Solution Authors