Forum Discussion
IoanCosmin
Helper III
8 years agoDAX measure with month variable based on a date field
I am having a hard time getting the following measure to work. I am trying to change the target based on a date filter. My filter is the Workday columns, where Workday is a standard date column. sMon...
- 8 years ago
BILASolution
Solution Specialist
8 years agoHi IoanCosmin
Try this measure...
Cars Inspected =
VAR
selectedMonth = MONTH(SELECTEDVALUE('All Cars Inspected'[Workday]))
RETURN CALCULATE(SUM(Targets[Target]),
ALL(Targets),
FILTER(Targets,Targets[Location]="Texas"),
FILTER(Targets,Targets[Description]="CarsInspected"),
FILTER(Targets,Targets[sMonth]=selectedMonth))
I hope it helps
BILASolution
IoanCosmin
Helper III
8 years agoHello BILASolution
I tried it and I still get a blank. I also tried this variation:
Cars Inspected =
VAR
selectedMonth = MONTH(SELECTEDVALUE('All Cars Inspected'[Workday]))
RETURN CALCULATE(SUM(Targets[Target]),
FILTER(ALL(Targets),
Targets[Location]="Texas" &&
Targets[Description]="CarsInspected" &&
Targets[sMonth]=selectedMonth))
... same result :(