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
admin11
Memorable Member
Memorable Member

How to make my YTD Qty display as 176 ?

Hi All

I have a expression which compute YTD Qty sold. 

 

Sales YTD QTY =
var _max = today()
return
calculate(TOTALYTD(sum('SALES'[quantity]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
 
Above expression seen correct , but not sure why it not return 176 ?

admin11_0-1620559244767.png

My PBI file

https://www.dropbox.com/s/p5ce3p3juf2sux8/PBS_VER050%20SI_PM.pbix?dl=0

 

Paul

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @admin11 

Not clear about the result you want, but if you want to make Sales YTD QTY display as quantity, try this:

Create the measure:

YTD test = calculate(SUM(SALES[quantity]),DATESYTD(DATEADD('Date'[Date],0,YEAR)))

v-xiaotang_0-1620710937349.png

 Hope this helps.

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @admin11 

Not clear about the result you want, but if you want to make Sales YTD QTY display as quantity, try this:

Create the measure:

YTD test = calculate(SUM(SALES[quantity]),DATESYTD(DATEADD('Date'[Date],0,YEAR)))

v-xiaotang_0-1620710937349.png

 Hope this helps.

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Fowmy
Super User
Super User

@admin11 

You simply use the formula as follows:

Sales YTD Qty = TOTALYTD(sum('SALES'[quantity]),'Date'[Date])

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

sayaliredij
Super User
Super User

Hi @admin11 

 

You can create the following formula for Total Quantity

 

Total Quantity = SUM(SALES[quantity])
 
and use this formule for YTD
 
Total Quantity YTD = 

    TOTALYTD([Total Quantity], 'Date'[Date].[Date])
 
Regards,
Sayali

If this post helps, then please consider Accept it as the solution to help others find it more quickly.

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.