Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm stuck trying to get a count of values in a column that depends on several other columns.
I have a table with many Item Numbers. Each Item Number appears in several Locations and within each location it can have a different Type and different Supplier. None of the columns are related. For each Item Number I need the count of suppliers for that location, but I need to ignore any rows with Type = X.
Item Number | Location | Type | Supplier | *Expected* Supplier Count |
6240 | A1 | X | 123 | 1 |
6240 | A1 | P | 111 | 1 |
6240 | A1 | T | 111 | 1 |
6240 | E2 | X | 111 | 2 |
6240 | E2 | P | 123 | 2 |
6240 | E2 | P | 111 | 2 |
Ultimately, I'm also trying to get a measure with the number of items that have more than one supplier, in the example above the answer is 1.
Solved! Go to Solution.
@Anonymous , A new column
calculate(distinctcount(Table[Supplier]), filter(Table, [Item Number] = earlier([Item Number]) && [Location] = earlier([Location]) && [Type]<> "X"))
@Anonymous , A new column
calculate(distinctcount(Table[Supplier]), filter(Table, [Item Number] = earlier([Item Number]) && [Location] = earlier([Location]) && [Type]<> "X"))
Thanks, that worked. EARLIER is what I was missing, I have some reading to do!
User | Count |
---|---|
73 | |
70 | |
38 | |
25 | |
23 |
User | Count |
---|---|
96 | |
93 | |
50 | |
43 | |
42 |