powerbi - Use Slicer selection in calculated column (Parameter) -
i have: - slicer dates , table 'log' column 'date' dates , column 'max' numbers (e.g. 0,31)
i need calculate average of values in column 'max' when date before slicer selection date - , average after.
end result: card visualisation average of values before selected date , card visualisation average of values after selected date.
create 3 measures:
avg = average('log'[max])
averageafterselecteddate = calculate ( [avg], filter ( ( 'log' ), [date] > minx ( 'log', 'log'[date] ) ) )
averagebeforeselecteddate = calculate ( [avg], filter ( ( 'log' ), 'log'[date] < minx ( 'log', [date] ) ) )
just use averagebeforeselecteddate
, averageafterselecteddate
measures in cards.
for data:
it produces:
let me know if helps.
Comments
Post a Comment