Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I want to calculate YTD based on 4-4-5 weeks, my fiscal year is for example, 2019/2022, 2020/2021, and 2021/2022, and the Month is from April to March. However, due to the 4-4-5 weeks, sometime the fiscal end month might be in first week in April and fiscal start month might be the 2nd week of April.
Note it is not a typical 1st of April to 31st March.
I wrote a dax
YTD =
var CurYr = max(DateLookup[Fiscal Year])
var latestDate =
calculate( max(DateLookup[Date]) , DateLookup[Fiscal Year]=CurYr)
return
TOTALYTD(sum(HS_LeadingIndicators[Target_In_Period]), DateLookup[Date],Format(latestDate, "mm/dd"))
I'm getting error message
The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.
How can I fix this error message?
Hi @Anonymous
What do you have FORMAT inside TOTALYTD? FORMAT returns text data type. Sure this will generate error
I want to use the Format to return the mm/dd and it will supply it to the TOTALYTD function.
Is there another way
@Anonymous
I don't see the reason behind that. Just take out FORMAT from picture and the error should go away. Then if the results do not match the requirement then please let me know what should be the expected result.
User | Count |
---|---|
77 | |
76 | |
45 | |
31 | |
26 |
User | Count |
---|---|
98 | |
89 | |
52 | |
48 | |
46 |