Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I am struggling and starting to think there isnt a straight forward way to filter this table the way i need.
I want to display and count the rows left after I filter out rows that has
"VehicleStockStatusCode" = 23 AND "TotalBookValue" = 0
combinded on the same rowcontext.
I tried below but that filters them seperatly, not as combind row
Vehicle Stock (Filtered) =
CALCULATE( COUNTA(FactVehicleStock[Vehicle_KEY]),
FILTER( FactVehicleStock,
( FactVehicleStock[TotalBookValue] <> 0 && FactVehicleStock[VehicleStockStatusCode_KEY] <> 60 ) //60 = 23
)
Result should be 18
| VehicleNumber | VehicleStatusCode | TotalBookValue | NumberOfDaysInStock | ||
| 76569 | 24 | 317937 | 505 | ||
| 77237 | 33 | 0 | 0 | ||
| 78325 | 24 | 373161 | 385 | ||
| 79076 | 24 | -17983 | 341 | ||
| 79096 | 24 | -25178 | 338 | ||
| 79203 | 24 | 10656 | 335 | ||
| 79319 | 24 | -13683 | 327 | ||
| 79395 | 23 | 0 | 0 | ||
| 79456 | 23 | 0 | 0 | ||
| 79480 | 24 | -19022 | 313 | ||
| 80080 | 23 | 0 | 0 | ||
| 80254 | 24 | -15267 | 258 | ||
| 80257 | 24 | 39 | 258 | ||
| 80753 | 24 | -15267 | 244 | ||
| 80774 | 24 | 47 | 243 | ||
| 80932 | 23 | 0 | 0 | ||
| 80933 | 23 | 0 | 0 | ||
| 80934 | 23 | 0 | 0 | ||
| 81080 | 23 | 0 | 0 | ||
| 81782 | 23 | 0 | 0 | ||
| 81960 | 23 | 0 | 0 | ||
| 82562 | 23 | 0 | 0 | ||
| 82564 | 23 | 0 | 0 | ||
| 82565 | 24 | 512 | 147 | ||
| 83044 | 24 | 0 | 112 | ||
| 83141 | 24 | 4201 | 103 | ||
| 83388 | 23 | 3249 | 0 | ||
| 83497 | 23 | 0 | 0 | ||
| 83510 | 24 | 0 | 65 | ||
| 83747 | 24 | 0 | 48 | ||
| 84251 | 24 | 0 | 19 |
Solved! Go to Solution.
You could try
Vehicle stock ( filtered ) =
VAR FilteredRows = CALCULATETABLE(
VALUES( 'FactVehicleStock'[VehicleNumber] ),
FactVehicleStock[TotalBookValue] = 0 && FactVehicleStock[VehicleStatusCode] = 23
)
RETURN CALCULATE(
COUNTROWS('FactVehicleStock'),
EXCEPT( VALUES('FactVehicleStock'[VehicleNumber]), FilteredRows)
)
You could try
Vehicle stock ( filtered ) =
VAR FilteredRows = CALCULATETABLE(
VALUES( 'FactVehicleStock'[VehicleNumber] ),
FactVehicleStock[TotalBookValue] = 0 && FactVehicleStock[VehicleStatusCode] = 23
)
RETURN CALCULATE(
COUNTROWS('FactVehicleStock'),
EXCEPT( VALUES('FactVehicleStock'[VehicleNumber]), FilteredRows)
)
Thnx johnt75 it worked as expectet 👍
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 8 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 29 | |
| 24 | |
| 17 | |
| 11 | |
| 10 |