- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Card result can't display value (Current YTD vs Previous YTD)
Hi gentlemen,
I am struggling to try to resolve this problem in my PowerBI dashboard. Hope you can help.
I have a card visual which will show the percentage result of the comparison between current YTD against previous YTD.
However, the error message appeared when I slice and filter with other dropdown selection.
Let me show you..
----------------------------------------------------------------------------------------------------
Under normal circumstance, when user did not select and filter any selection criteria in dropdown selection filter, all the following visual appear and calculation is accurate. (refer to first column scenario)
However, when I select and filter other object in the selection dropdown, the error display in the CARD and Table (refer to the second column scenario).
Normal Circumstance (correct outcome) - all objects are selected in selection dropdown | Abnormal Circumstance (error outcome) - when certain objects are selected in selection dropdown |
The following is the DAX used in the computation.
(Current YTD - Previous YTD) DIVIDED BY (Previous YTD)
IME_YTD-IME_PreYTD_% = DIVIDE(
([IME_charges_YTD1]-[IME_charges_PreYTD1]),
[IME_charges_PreYTD1]
)
Current YTD calculation
IME_charges_YTD1 = TOTALYTD(
'IME'[Tot_IME-amt_incl_tax],
IME[File Date]
)
Previous YTD calculation
IME_charges_PreYTD1 =
Calculate(IME[IME_charges_YTD1],
SAMEPERIODLASTYEAR(IME[File Date])
)
Thank You.
Aiyo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Question: do you have a date table and is it marked appropriately in your data model? SAMEPERIODLASTYEAR() is a time intelligence function that requires a properly indicated date table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Also the error message seems fairly clear that it requires a list of dates without gaps. This would be accomplished with a properly created date table.
Make the date table. Create relationships between that table and the relevant tables. You should be good then.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
12-12-2022 05:14 PM | |||
01-11-2024 01:41 AM | |||
06-17-2024 08:07 PM | |||
03-11-2024 09:54 AM | |||
07-23-2024 03:01 PM |
User | Count |
---|---|
137 | |
107 | |
85 | |
59 | |
46 |