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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
VikramShah
Regular Visitor

Issues in MTD/QTD/YTD standard measures

Hi,

 

I have a very simple data wherein there are only 3 columns Date/Segment/Values, however there is no data for Defense Category in the month of April. But when I use the MTD/QTD/YTD standard measures Power Bi shows me data from earlier Month (for MTD), earlier Quarter (for QTD) and earlier Year (For YTD). What I want to know is that, is there a bug in the standard MTD/QTD/YTD queires or am I doing something wrong. I have attached the excel snapshot along with Power Bi table image where there is simple SUM used and other image showing Power Bi table where I have used MTD/QTD queries. Also I noted that the Defense values are not added in the Total.

I am also attaching the quries below:

MTD = TOTALMTD(SUM(Sheet1[Value]),Sheet1[Date])
QTD = TOTALQTD(SUM(Sheet1[Value]),Sheet1[Date])

 

VikramShah_1-1621263700545.png

VikramShah_2-1621263726152.png

 

1 ACCEPTED SOLUTION

Hi @VikramShah ,

Even after removal of Months I am getting correct results. 
I added a record to the existing sample.

mah_priya94_0-1621316382196.png

SInce MTD and YTD are DAte functions, latest date (Month and Quarter) is considered in order to evaluate MTD and QTD since no date elements are given to provide the division.

 

mah_priya94_1-1621316448586.png

 

 

View solution in original post

5 REPLIES 5
mah_priya94
Helper I
Helper I

Hi @VikramShah ,

Would suggest you create a Calendar Table using the following DAX :

Date = CALENDAR(MIN(Table_2[Column1]), MAX(Table_2[Column1]))
Link this Calendar table to the main table 
mah_priya94_0-1621282960595.png

 

Then make the following changes in your existing MTD and QTD DAX measures:

MTD = TOTALMTD(SUM(Table_2[Value]), 'Date'[Date])
QTD = TOTALQTD(SUM(Table_2[Value]), 'Date'[Date])
 
I used the following data as a sample:
mah_priya94_1-1621283094646.png

 

and got the results !

mah_priya94_2-1621283146551.png

 

@mah_priya94thanks for the reply, but still it is giving me the same results.

You have put the months in Columns in the matrix. Kindly remove the months from coulmn and check the result. I am doing so because eventually I am going to make a pie chart of this.

Hi @VikramShah ,

Even after removal of Months I am getting correct results. 
I added a record to the existing sample.

mah_priya94_0-1621316382196.png

SInce MTD and YTD are DAte functions, latest date (Month and Quarter) is considered in order to evaluate MTD and QTD since no date elements are given to provide the division.

 

mah_priya94_1-1621316448586.png

 

 

Greg_Deckler
Super User
Super User

@VikramShah You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ 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...

@Greg_DecklerI am getting the same result using the DAX from your first link

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.