Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
Is there any way to show YTD on card visual without using date reference (slicer/filter)?
It shows blank on card visual untill any date reference not provided.
YTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE(YEAR(TODAY()), 1, 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
or
YTD Orders = TOTALYTD( [Net Price], 'Date Table'[Date],
DATESBETWEEN('Date Table'[Date],
MIN('Date Table'[Date]), MAX(Date Table'[Date])
))
Thanks
Unfortunately, in Power BI, in order to show YTD on a card visual, you need to have a date reference, either through a slicer or a filter. This is because the YTD calculation relies on a date context to determine the period of time to sum up the values for. However, you can use a workaround to achieve the desired result.
One possible workaround is to create a measure that calculates the YTD total for the current year and use it in the card visual. You can create a measure like this:
YTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', YEAR('Date Table'[Date]) = YEAR(TODAY())), ALL('Date Table'))
This measure calculates the YTD total for the current year by filtering the 'Date Table' to include only the dates in the current year, and then summing up the 'Net Price' column in the 'Orders 2' table. The ALL function is used to remove any existing filters on the 'Date Table' to ensure that the measure returns the correct result regardless of any filters applied to the report.
You can then use this measure in the card visual to show the YTD total without the need for a date reference.
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 |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |