Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I would like to make a count on a table, but excluding first some elements in another table. The next example may clarify the situation:
Table A:
| User | Product |
| A | Product A |
| B | Product B |
| C | Product B |
| D | Product B |
| E | Product A |
| F | Product C |
Table B:
| User | |
| A | A@outlook.com |
| B | B@outlook.com |
| C | C@outlook.com |
| D | D@outlook.com |
| E | E@outlook.com |
| F | F@outlook.com |
| G | G@outlook.com |
| H | H@outlook.com |
| I | I@outlook.com |
Table A and Table B will have a relationship of 1:1 by user. Filtering table A by "Product A", I would like to count the users in table B different from those filtered in Table A:
Table B filtered:
| User | |
| B | B@outlook.com |
| C | C@outlook.com |
| D | D@outlook.com |
| F | F@outlook.com |
| G | G@outlook.com |
| H | H@outlook.com |
| I | I@outlook.com |
And the count result should be 7. Any ideas on how to achieve it?
Best regards,
Carlos
Solved! Go to Solution.
Hi, @crodrigueza
Since you have created a one-to-one relationship in two tables.
You can directly create the measure like this:
Measure = var a= COUNTROWS(TableB)
var b=COUNTROWS(ALL(TableB))
return b-a
Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Hi, @crodrigueza
Since you have created a one-to-one relationship in two tables.
You can directly create the measure like this:
Measure = var a= COUNTROWS(TableB)
var b=COUNTROWS(ALL(TableB))
return b-a
Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 65 | |
| 39 | |
| 33 | |
| 23 |