Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Imagine the table below
Staff | Animal | House | Color |
A | Dog | Big | Red |
B | Cat | Small | Green |
C | Mouse | Large | Blue |
D | Cat | Big | Red |
E | Camel | Small | Red |
F | CatFish | Big | Red |
Using a measure, I'm looking to filter the table so that I can find which staff that have Animals that start with "Cat*"
Staff | Animal | House | Color |
B | Cat | Small | Green |
D | Cat | Big | Red |
F | CatFish | Big | Red |
Total | 3 | 3 | 3 |
Is this possibe? I can get counts of Cat* and I can filter with the "Cat*", but I am stuck in producing a table with Counts.
Thoughts?
Solved! Go to Solution.
This is pretty rough, but here is one way to do it. PBIX attached.
Measure =
IF(HASONEVALUE('Table'[Animal]),
IF(SEARCH("Cat",MAX('Table'[Animal]),,0) > 0,1,0),
SUMX(
ADDCOLUMNS(
'Table',
"__Measure",IF(SEARCH("Cat",[Animal],,0) > 0,1,0)
),[__Measure]
)
)
This is pretty rough, but here is one way to do it. PBIX attached.
Measure =
IF(HASONEVALUE('Table'[Animal]),
IF(SEARCH("Cat",MAX('Table'[Animal]),,0) > 0,1,0),
SUMX(
ADDCOLUMNS(
'Table',
"__Measure",IF(SEARCH("Cat",[Animal],,0) > 0,1,0)
),[__Measure]
)
)
Wow!
I'm still tying to understand why and how this works, but it does!
I have not used ADDCOLUMNS or HASONEVALUE so I have some research to do.
Many Thanks again
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |