Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a customer who has a delivery time that is different from the rest of the other customers, for this customer the time is <= 9 while for the rest the time is <= 8
How do I only count customer times for UNBCES when the delivery time is <=9 at the same time I filter the data of other customers which is <=8
My attempt was first to count the values of the UNBCES client and then take these values and filter again the other clients that have a shorter time, which is <=8, but it didn't work
UNBCES_CLIENT count
UNBCES_CLIENT =
var UNBCES =
CALCULATE(
COUNTROWS(fcriticalDemands),
FILTER(
fcriticalDemands,
fcriticalDemands[CLIENT]="UN-BC" &&
fcriticalDemands[deliveryTime]<=9))
return UNBCES
UNBCES_CLIENT and trying to count the rest of the clients
CLIENTS =
var CLIENT=
CALCULATE(
Leadtime[UNBCES_CLIENT],
FILTER(
fcriticalDemands,
fcriticalDemands[deliveryTime]<=8))
return CLIENT
can you share a sample data and let us know how do you like to show the result?
BTW, if you want to count with different values, try this:
Count_CLIENT =
Vat _Time = if(fcriticalDemands[CLIENT]="UN-BC",9,8)
var _Count=
CALCULATE(
COUNTROWS(fcriticalDemands),
FILTER(
fcriticalDemands,
fcriticalDemands[deliveryTime]<=_Time))
return
_Count
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
I want to show something like this, but I have to calculate it differently for the UN-BC client and for the others it's the same thing
The other colors refer to other time calculations, the green value is what we think of the ideal time, which for the un-bc client is <=9
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
21 | |
11 | |
10 | |
9 | |
8 |