Forum Discussion
Anonymous
3 years agoNot applicable
Calculate date filter
Hello, I ve been trying to improve my calculation with additional date filter, but it doesnt make any diff. It behaves like it calculates the result for all dates Everything is calcula...
- 3 years ago
Anonymous
Please tryYield Mech. assemblyprevmonth = VAR CurrentYearMonth = MAX ( 'Date'[Year Month Number] ) VAR MechAssembly = CALCULATETABLE ( TJob, TJob[SekundærNavn] = "Mech. assembly", 'Date'[Year Month Number] = CurrentYearMonth - 1, ALL ( 'Date' ) ) RETURN ROUND ( DIVIDE ( SUMX ( MechAssembly, TJob[FirstPassQty] ), SUMX ( MechAssembly, TJob[Antal] ) ), 4 )
Anonymous
3 years agoNot applicable
Idk know why but the measure keeps displaying blank after previous month function. So as few others i had try for example
Date column is correctly formatted as date, rest as whole number.
tamerj1
Community Champion
3 years agoAnonymous
Does this work for you?
- Anonymous3 years agoNot applicable
Could you reference measure to VAR version. Contoso model looks very good, refering to year month number is pretty nifty idea, but when i tried to copy results....
It still wont give me the previous month
- tamerj13 years ago
Community Champion
Anonymous
Can you copy/paste this code so I can modify?- Anonymous3 years agoNot applicableYield Mech. assemblyprevmonth =VAR MechAssembly =FILTER ( TJob, TJob[SekundærNavn] = "Mech. assembly" )RETURNCALCULATE(ROUND(DIVIDE (SUMX ( MechAssembly, TJob[FirstPassQty] ),SUMX ( MechAssembly, TJob[Antal] ) ),4),ALL('Date'),'Date'[Year Month Number] = MAX('Date'[Year Month Number]) -1)