Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello!
I'm working on creating my first report in PowerBi and have had to use metric time calculations due to my ISO calendar 4-4-5 which goes across years. I've been able to create metrics such as "YTD units" that are pulling back correctly, but for my "Prior YTD" metrics, it does not seem to be working and I don't know what I am missing.
I've checked and my fiscal_year_nr is formatted as #, so it should be able to subtract.
YTD Formula that is working:
FYTD Units = IF (
HASONEVALUE ( 'Date'[Fiscal_year_nr] ),
CALCULATE (
SUM ( Invoice_Detail[Units] ),
FILTER (
ALL( 'Date' ),
'Date'[Fiscal_year_nr] = VALUES ( 'Date'[Fiscal_year_nr] )
&& 'Date'[Date] <= MAX ( 'Date'[Date] )
)
),
BLANK ()
)
Prior Year To Date formula (NOT WORKING):
PYTD Units =
IF (
HASONEVALUE ( 'Date'[Fiscal_year_nr] ),
CALCULATE (
SUM (Invoice_Detail[Units]),
FILTER (
ALL ( 'Date' ),
'Date'[Fiscal_year_nr] = VALUES ( 'Date'[Fiscal_year_nr] ) - 1
&& 'Date'[Date] <= MAX ( 'Date'[Date] )
)
),
BLANK ()
)
Thank you
What results are you actually getting that make you think it's not working? The two formulas look identical
Sorry- must have copied the Pr YTD formula incorrectly, I've updated it in the post.
The formula is returning the Prior Year number, however it is returning the FULL month number vs. the "to-date" prior month. For example, it is pulling data for October last year and not October last year through 10/18.
Thank you!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |