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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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)

 


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

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors