Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have measures that count year to date values for issues by status.
I use these measure as values for a stacked area graph.
These measure work when I hard code the Year_End_Date, e.g. "4-30"
_AMZLissuesAnswered = Calculate(TOTALYTD(DISTINCTCOUNTNOBLANK('issues_issues'[issue_id]),'issues_issues'[updated_at].[Date], "4-30"), 'issues_issues'[status] = "answered")
but I get the error A function 'Placeholder' has been used in a True/False expression...
when I replace it with a variable.
_CurrentDay = FORMAT(NOW(), "m-dd")
What am I missing in my variable _CurrentDay to work in the TotalYTD DAX function?
Solved! Go to Solution.
I solved this through a different approach.
Instead of creating a measure for each status type with the TotalYTD function, I created a single measure for the status, and used status for the legend.
_Status2022 =
VAR MaxDate = MAX('issues_issues'[updated_at].[Date])
RETURN
CALCULATE(COUNT('issues_issues'[issue_id]),
DATESBETWEEN('issues_issues'[updated_at].[Date], "1-1-2022", MaxDate)
)
In addition, the previous method with TotalYTD was also counting issues in previous years. The solution filters the count to a specific year now.
I solved this through a different approach.
Instead of creating a measure for each status type with the TotalYTD function, I created a single measure for the status, and used status for the legend.
_Status2022 =
VAR MaxDate = MAX('issues_issues'[updated_at].[Date])
RETURN
CALCULATE(COUNT('issues_issues'[issue_id]),
DATESBETWEEN('issues_issues'[updated_at].[Date], "1-1-2022", MaxDate)
)
In addition, the previous method with TotalYTD was also counting issues in previous years. The solution filters the count to a specific year now.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |