Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
PeterGHEBS
Contributor
Contributor

Previous Year Data

Hello All, 

I have expression like this:

if(KPI='STEC', sum({<[YTD/MTD]={'YTD'}>}[Thermal energy consumption (kiln)])/sum({<[YTD/MTD]={'YTD'}>}[Clinker production volume]),

it shows me YTD data for STEC KPI for selected Year. 

I need to have one more column named Previous Year YTD in my table which will show data for STEC for same period of previous year.

For Example, if I choose Year 2023 and Month Feb, in Column YTD I would like to see data for Feb 2023 and in Colum Previous Year YTD data for Feb 2022.

 

Thank you

 

Labels (1)
1 Reply
mpc
Partner - Specialist
Partner - Specialist

Hi, 

If YTD is your Date field, then can you try this ? 

if(KPI='STEC', sum({<[YTD/MTD]={'YTD'},YTD={"$(=AddYears(YTD,-1))"}>}[Thermal energy consumption (kiln)])/sum({<[YTD/MTD]={'YTD'},YTD={"$(=AddYears(YTD,-1))"}>}[Clinker production volume])

Regards

From Next Decision and mpc with love