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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

YTD - Quick Measure for YOY

Hi all,

 

I am trying to create this report for my sales team:

 

 

Customer2015 YTD Sales2016 YTD Sales
ABC1000011000
DEF2000022000
XYZ3000033000

 

 

I am using this a quick measure with this DAX:

 

OrderTotal YTD =
IF(
 ISFILTERED('DateDim'[DIMDATE]),
 ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy."),
 TOTALYTD(SUM('OrderHeaderDim'[OrderTotal]), 'DateDim'[DIMDATE].[Date])
)

 

I recieve this result:

YTD.JPG

 

 

 

 

 

 

I would expect not to see November and December for 2016. I have also tried writing my own DAX but get the same result. 

 

Thank you in 

 

 

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF(ISBLANK(SUM('OrderHeaderDim'[OrderTotal])),BLANK(),IF(
 ISFILTERED('DateDim'[DIMDATE]),
 ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy."),
 TOTALYTD(SUM('OrderHeaderDim'[OrderTotal]), 'DateDim'[DIMDATE].[Date])
))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks for your reply! Sorry didn't work. Here is the result:

 

ytd2.JPG

 

As you can see October, November and December are showing for 2016. 

 

Hi,

 

Share the link from where i can download your file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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