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 want to create a measure to count the number of rows based on the following criteria:
OR
OR
Solved! Go to Solution.
please see the attachment below. hope this is helpful
Proud to be a Super User!
please see the attachment below
Proud to be a Super User!
is this what you want?
Measure =
VAR _count=DISTINCTCOUNT('Table (2)'[Period])
return if(sumx(VALUES('Table (2)'[Period]),_count)>1,1, sumx(VALUES('Table (2)'[Period]),_count))
i think this will affect both column total and row total.
Proud to be a Super User!
@ryan_mayu Thanks for the response, but it seems that is not working right. It showed the number 1 instead of 5 when I put it on the card.
please try this
Measure =
VAR _count=distinctcount('Table'[period])
VAR _count2=if(_count>1,1,_count)
return sumx(VALUES('Table'[period]),_count2)
Proud to be a Super User!
@ryan_mayu Thanks again for the response, but the answer should be 5 instead of 3.The measure should count the codes (256,258,262,264,269).
Let me remind you that the measure idea is the following.
OR
OR
please see the attachment below. hope this is helpful
Proud to be a Super User!
@ryan_mayu Thanks a lot. It works great.😊
I have something additional if you have the kindness to help me. I also want to create a measure to count the rows that have for sure a value at period 3 and (a value in period 2 OR period1). For this case, the answer should be 3 . (rows 258,262,269)
please see the attachment below
Proud to be a Super User!
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 | |
| 38 | |
| 31 | |
| 27 | |
| 26 |