Forum Discussion
How to count two columns with names without repeating?
- 6 years ago
Hi,
In the Query Editor, right click on the Operadores column and select Split column. Split by rows there. Create a Calendar Table and build a relationship from the Data column to the Date column of the Calendar Table. Create a slicer from the Date column of the Calendar Table and select any date there. Write this measure
=DISTINCTCOUNT('Table1'[Operadores])
Hope this helps.
Can you post sample data as text so I can test? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Ok! Here it is.
| DATA | MÁQUINA | OPERADORES | PRODUÇÃO |
| 10/01/2020 | 1 | A,B | 1 |
| 10/01/2020 | 2 | C | 1 |
| 10/01/2020 | 3 | D | 1 |
| 10/01/2020 | 4 | E | 1 |
| 10/01/2020 | 5 | A | 1 |
| 10/01/2020 | 6 | B | 1 |
| 11/01/2020 | 1 | A | 1 |
| 11/01/2020 | 2 | C,B | 1 |
| 11/01/2020 | 3 | D | 1 |
| 11/01/2020 | 4 | E | 1 |
| 11/01/2020 | 5 | B | 1 |
| null | null | null | null |
- Ashish_Mathur6 years ago
Super User
Hi,
Did you try my solution?
- gabrielrosa6 years agoFrequent Visitor
Hey, Ashish!
It worked!
Thank you so much for the insight!
However, I have to create a copy of the database with only the dates and names of the operators, cause dividing the row, the production column is divided too, like this:
DATE OPERATOR PRODUCTION 16/03 A , B 10 After dividing:
DATE OPERATOR PRODUCTION 16/03 A 10 16/03 B 10 But no problem. It's a solution!
Thank you so much.
- Ashish_Mathur6 years ago
Super User
You are welcome.