Forum Discussion
CountIf-Type Function in DAX
- 4 years ago
Hi Anonymous
Try this measure:
Measure = VAR _A = FILTER ( ADDCOLUMNS ( production_data, "Sche-Date", LOOKUPVALUE ( schedule_date[Schedule date], schedule_date[Lot number], production_data[Lot number] ) ), [Production start date] = [Sche-Date] ) RETURN COUNTROWS ( _A )Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi Anonymous
Try this measure:
Measure =
VAR _A =
FILTER (
ADDCOLUMNS (
production_data,
"Sche-Date",
LOOKUPVALUE (
schedule_date[Schedule date],
schedule_date[Lot number], production_data[Lot number]
)
),
[Production start date] = [Sche-Date]
)
RETURN
COUNTROWS ( _A )
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hello again! Is there a way to extract those lot numbers that were counted? So instead of counting the lots I would be able to see which lots were run?
Here is another column of the data I'm using. The end goal is to create card visualizations counting the number of lots based on type. "count of type A lots that actually ran on the date they were supposed to" "count of type B lots that actually ran on the date they were supposed to", etc
Schedule table
Schedule date | Lot number | Lot Type |
10252021 | 12345 | A |
10252021 | 23456 | B |
Production table
Production start date | Lot number | Lot type |
10252021 | 12345 | A |
10262021 | 23456 | B |