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.
Hi community,
I want to the count of unique invoices in a invoice columns
Invoice eg:
2023/Q3/141
2023/Q3/143
But there is a catch,
If the invoice numbers are like,
2023/Q3/145/1
2023/Q3/145/2
These should be counted as one as well.
Need some help.
Thanks and regards,
Rishab jain
@parry2k Thanks for helping me with 3 rolling averages formula.
Solved! Go to Solution.
Hi,
Thank you for a quick response!
I have tried this but it will not take 2023/Q3/251/1
2023/Q3/251/2 has single count.
so both formats exist?
InvoiceNumber = 2023/Q3/145
Is this a sub invoice? 2023/Q3/145/2 with the extra "/2"
If you want the following to return a distinct count of 1.....
2023/Q3/145/1
2023/Q3/145/2
2023/Q3/145/3
2023/Q3/145/4
2023/Q3/145/5
DistinctCount should work. But you need to add new column that trims the InvoiceNumber down to the actual Invoice number (lets call it RootInvoiceNumber) to run the distinct count on. Example:
InvoiceNumber , RootInvoiceNumber
2023/Q3/145/1 , 2023/Q3/145
2023/Q3/145/2 , 2023/Q3/145
2023/Q3/145/3 , 2023/Q3/145
2023/Q3/145/4 , 2023/Q3/145
2023/Q3/145/5 , 2023/Q3/145
so both formats exist?
InvoiceNumber = 2023/Q3/145
Is this a sub invoice? 2023/Q3/145/2 with the extra "/2"
If you want the following to return a distinct count of 1.....
2023/Q3/145/1
2023/Q3/145/2
2023/Q3/145/3
2023/Q3/145/4
2023/Q3/145/5
DistinctCount should work. But you need to add new column that trims the InvoiceNumber down to the actual Invoice number (lets call it RootInvoiceNumber) to run the distinct count on. Example:
InvoiceNumber , RootInvoiceNumber
2023/Q3/145/1 , 2023/Q3/145
2023/Q3/145/2 , 2023/Q3/145
2023/Q3/145/3 , 2023/Q3/145
2023/Q3/145/4 , 2023/Q3/145
2023/Q3/145/5 , 2023/Q3/145
After you suggested to create a new column..... I open power query and used display 0 or 1 if we have certain condition and then used that column to set a condition for split based of delimiter. Thank you for your help
Hi,
Thank you for a quick response!
I have tried this but it will not take 2023/Q3/251/1
2023/Q3/251/2 has single count.
@rishabjain237 Seems like DISTINCTCOUNT or COUNTROWS(DISTINCT(SELECTCOLUMNS( ... ) ) ) should work for this.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
81 | |
67 | |
61 | |
46 | |
45 |