Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a Dax filter that correctly filters to hard coded values, How can I change this to use the Filters of the current PBI visualisation page filter selection, Id also like the Date to use the SAMEPERIODLASTYEAR() for the date filter ?
What I have so far is :
previousYear = CALCULATE (
SUM ( 'vw Monthly Milk Production'[value] ),
FILTER (
All('vw Monthly Milk Production'),
'vw Monthly Milk Production'[adjustment] == "30 Day adjustment"
&& 'vw Monthly Milk Production'[Type] == "Natural Content"
&& 'vw Monthly Milk Production'[country] == "United Kingdom"
&& 'vw Monthly Milk Production'[date] == value("2020-02-01")
)
)
Ive got a bit further with below, but the sameperiod last year function, returns an empty filed in my pbi table, What Do I need to do to provide this expression with the correct context please ?
previousYear = CALCULATE (
SUM ( 'vw Monthly Milk Production'[value] ),
FILTER (
ALLSELECTED('vw Monthly Milk Production'),
'vw Monthly Milk Production'[date] == SAMEPERIODLASTYEAR(Dates[Date].[Date])
)
)
User | Count |
---|---|
42 | |
28 | |
23 | |
18 | |
16 |
User | Count |
---|---|
54 | |
35 | |
18 | |
18 | |
15 |