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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors