Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello - I am using the QTD measure below and it works fine.
However, the YTD measure just returns a blank value. I know there are various ways to calculate YTD, but I am trying to standardized my formulaes and I like this formula because it hides future dates with no values. Any idea why the YTD is returning blank...and how to fix it but still maintaining this general formula structure.
Solved! Go to Solution.
Hi @Anonymous ,
You can use the following two measure:
YTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
QTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE ( YEAR (TODAY()), ROUNDUP(DIVIDE(MONTH(TODAY()),3 ),0 ) *3 -2, 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
You can use the following two measure:
YTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
QTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE ( YEAR (TODAY()), ROUNDUP(DIVIDE(MONTH(TODAY()),3 ),0 ) *3 -2, 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
You can create your measure like here .
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
@stevedep Thanks Steve. I tried that and for some reason it still returns blank. But I see in the DAX editor you got it to work for you. Not sure why it is not on my data set. I can of course just use a sum of total measure which works just fine. But my original intention was to try and stay with the same formula structure that I am using in the MTD and QTD measures as I referenced above. I thought by just replacing "Quarter" with "Year" it would work, but it does not.
@Anonymous , Try to use time intelligence
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
YTD QTY forced=
var _max = today()
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESYTD('Date'[Date])), blank())
//or
//calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 72 | |
| 39 | |
| 35 | |
| 23 |