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.
Hello need refresher in coming up with this simple countrow measure.
Table 1 | Table 2 | |||
Site ID | Site ID | Category | ||
A | A | Building | ||
B | A | Passive | ||
C | B | Passive | ||
D | D | Building |
I need to countrows table1 re how many sites that have only passive category in table 2. In the example above, i should get 1 site which Site ID B. appreciate if you can help me on this
Solved! Go to Solution.
Hi @Anonymous
Try this measure
Measure_ =
VAR auxT_ =
CALCULATETABLE ( DISTINCT ( Table2[SiteID] ), Table2[Category] = "Passive" )
RETURN
COUNTROWS (
FILTER ( auxT_, CALCULATE ( DISTINCTCOUNT ( Table2[Category] ) ) = 1 )
)
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Hi @Anonymous
Try this measure
Measure_ =
VAR auxT_ =
CALCULATETABLE ( DISTINCT ( Table2[SiteID] ), Table2[Category] = "Passive" )
RETURN
COUNTROWS (
FILTER ( auxT_, CALCULATE ( DISTINCTCOUNT ( Table2[Category] ) ) = 1 )
)
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Thank you this is great just to confirm my understanding of the code. you first created a variable table just to identify which sites have "passive" category. then you iterate with said variable table using filter, to check which of this sites have 1 distinct category which should be passive.
Exactly. Good summary
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |