Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi guys,
Please help with this DAX
I need show the value by select YEAR vs PREVIOUS YEAR
I am using this expression:
Max Year = CALCULATE(SUM(MyTable[REAL]); FILTER ('TIMEDIM'; TIMEDIM[YEAR]=MAX(TIMEDIM[YEAR]) ) )
this return Real value of year
and
Previous Year = CALCULATE(SUM(MyTable[REAL]); PREVIOUSYEAR('TIMEDIM'[DATE]))
However when I put this measures in my table i have a repeat of previous year for all months
Like this
I have date from:
Year 2016 2015
Month Month
apr 10
jun 5 7
jul 4
However when i show in table i have all months with value 7
YEAR actual Previous
jan 7
feb 7
mar 7
apr 10 7
may 7
jun 5 7
jul 4 7
Not getting you properly but i have done something as below.
I have used few calculation one is for current year real value and the last year real value as below
Last Year Real value = IF(YEAR('Table name'[Date Field])=YEAR(NOW())-1 , 'Table name'[Real value])
Current Year Real value = IF(YEAR('Table name'[Date Field])=YEAR(NOW()),'Table name'[Real value])
I thnik you should attach your pbix so that i can have more idea and give you the best i can.
Thanks
Abhi.
Not clear about your data model, check the attached pbix based on my understanding.