Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
107 | |
68 | |
48 | |
44 | |
43 |