Join 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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a measure working as expected(below).
SalesCount = IF(
[QTY] <= 0,
"A",
IF(
ABS(1 - DIVIDE([Sales1], [Sales2])) < 10,
"B",
"A"
)
)
I need to count number of rows equal to "A" and
number of rows equal to "B" . For this calculations, I need to use measure.
Please help.
Thanks
Solved! Go to Solution.
Hi,
I am not sure how your datamodel, and how your expected visualization looks like, but please try the below.
Count A: =
VAR _tableA =
FILTER (
ADDCOLUMNS (
VALUES ( TableName[ColumnInTheVisualization] ),
"@salescount", [SalesCountMeasure]
),
[@salescount] = "A"
)
RETURN
COUNTROWS ( _tableA )
Count B: =
VAR _tableB =
FILTER (
ADDCOLUMNS (
VALUES ( TableName[ColumnInTheVisualization] ),
"@salescount", [SalesCountMeasure]
),
[@salescount] = "B"
)
RETURN
COUNTROWS ( _tableB )
Hi,
I am not sure how your datamodel, and how your expected visualization looks like, but please try the below.
Count A: =
VAR _tableA =
FILTER (
ADDCOLUMNS (
VALUES ( TableName[ColumnInTheVisualization] ),
"@salescount", [SalesCountMeasure]
),
[@salescount] = "A"
)
RETURN
COUNTROWS ( _tableA )
Count B: =
VAR _tableB =
FILTER (
ADDCOLUMNS (
VALUES ( TableName[ColumnInTheVisualization] ),
"@salescount", [SalesCountMeasure]
),
[@salescount] = "B"
)
RETURN
COUNTROWS ( _tableB )
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 6 | |
| 6 | |
| 6 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 18 | |
| 14 | |
| 14 |