Forum Discussion
Difficulty with Prior Year Measure up to Current Date
Hello,
I am trying to calculate YoY growth and prior year YoY growth in two measures for a Power BI report, and I am struggling to get Prior Year net billings up to the current date in order to then build these YoY growth rates.
My Net Billings measure is simple: Net Billings = SUM('Trans Detail Data'[Net Billings Amount]).
My PY Net Billings is configured as so:
As you can see in this hypothetical matrix, while my Net Billings PY measure stops pulling forward data from the previous fiscal year in the rows, the TOTAL row still calculates as if all fiscal year 2023 months have been brought forward. I would expect the measure to only have sum'd the values present in the rows in the table. How could I rebuild/construct my Net Billings PY measure such that the total is only the sum of Net Billings for the first four months of fiscal year 2023 (August - November 2022)?
2 Replies
- audreygerred
Super User
For TY you can use TOTALYTD DAX function, then for LY use CALCULATE([Your TY YTD Measure Name], SAMEPERIODLASTYEAR('Date'[Date]))
TOTALYTD function (DAX) - DAX | Microsoft Learn
Also, Marco Russo and Alberto Ferrari just published an article of using DAX for 'current' period: Computing MTD, QTD, YTD in Power BI for the current period - SQLBI
- Dangar332
Resident Rockstar
Hi, Anonymous
try belowIF( NOT(ISBLANK([Net Billings])), CALCULATE([Net Billings], 'tablename'[yearmaonth]= max('tablename'[yearmaonth])-12) )