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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I'm looking for some help.
I have a table with ordernumbers and invoicenumbers. Ordernumber is unique, but one order can have more invoicenumbers.
So for example:
| Invoicenumber | Ordernumber |
| 1 | 1 |
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 5 | 3 |
| 6 | 3 |
| 7 | 4 |
| 8 | 4 |
I want to group by how many invoices there are for an order.
So first I created a measure: count of invoicenumber = calculate(distinctcount(table[invoicenumber]))
So now I have:
| Ordernumber | Count of invoices |
| 1 | 2 |
| 2 | 1 |
| 3 | 3 |
| 4 | 2 |
Then I want to group by count of invoices, so I know how many times I have 1, 2, 3 etc. I don't know how to get there, but I would like the result to be like this:
| Group of count of invoices | Amount |
| 1 | 1 |
| 2-3 | 3 |
| 4 - more | 0 |
So then I will know that there are 3 orders which have 2 or 3 invoices, 0 orders with 4 or more invoices, e.g
Solved! Go to Solution.
Hi,
One of ways to create this is having a Grouping table like below.
Please check the below picture and the attached pbix file.
Invioce count group measure: =
COUNTROWS (
FILTER (
VALUES ( Data[Ordernumber] ),
[Count of invoice measure:] >= MIN ( 'Grouping'[min] )
&& [Count of invoice measure:] <= MAX ( 'Grouping'[max] )
)
) + 0
Yes! Thank you, this works like charm.
Hi,
One of ways to create this is having a Grouping table like below.
Please check the below picture and the attached pbix file.
Invioce count group measure: =
COUNTROWS (
FILTER (
VALUES ( Data[Ordernumber] ),
[Count of invoice measure:] >= MIN ( 'Grouping'[min] )
&& [Count of invoice measure:] <= MAX ( 'Grouping'[max] )
)
) + 0
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 52 | |
| 51 | |
| 35 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 92 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |