Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello guys, I'm really confused because I want to do this...
I have a table with this style
What I need is to Count how many times in a row the words "OutSite(MTY)" or "Rest Day" repeats.
Im looking to achieve this with the following formula
Absences = CALCULATE(
COUNTROWS('dbpenrh emergencypaymentroll'),
SEARCH("OutSite(MTY)",'dbpenrh emergencypaymentroll',1,0))The problem is that the SEARCH function doesn't "search" in all the table but needs at least 1 column...
Absences = CALCULATE(
COUNTROWS('dbpenrh emergencypaymentroll'),
SEARCH("OutSite(MTY)",'dbpenrh emergencypaymentroll'[Day_1],1,0))Thats different from what I need.
I need something like a range for the SEARCH that goes from Day_1 to Day_30...
How can I do this? Is really giving me a bad time ....
Any help is so much appreciated
Solved! Go to Solution.
Hi,
In the Query Editor, select all columns other than the Day columns > Right click > Unpivot other columns. Drag Value column to the row labels. Write this measure
=COUNTROWS(Data)
Hope this helps.
Hi,
In the Query Editor, select all columns other than the Day columns > Right click > Unpivot other columns. Drag Value column to the row labels. Write this measure
=COUNTROWS(Data)
Hope this helps.
Am not sure if this helps.
https://community.powerbi.com/t5/Desktop/Count-based-on-another-column/td-p/422765
it's a different situation, what I'm trying to do is
count emergencypaymentroll [Day_1],emergencypaymentroll [Day_2],emergencypaymentroll [Day_3] ..... emergencypaymentroll [Day_30] when = "OutSite(MTY)"
To get something like this, I think that I need One Measure per Search, but the first thing I need to solve is the search trought all the columns in the table.
OutSite(MTY) || 3 Rest Day || 2 Abscence || 1
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 76 | |
| 37 | |
| 31 | |
| 27 | |
| 27 |