cancel
Showing results for
Did you mean:  ## Count on a measure

Good afternoon.

I have created a measure (Historical Q V/H), whose results are Q1,Q2,Q3 and Q4.

I need to know how many values of each Q there are in the measure.

Q4 Count = COUNTROWS(FILTER(VALUES('Times Integrated Marker Advisor'[Agent]),'Times Integrated Scoreboard Advisor'[Historical Q V/H]="Q4"))
I have created the above measure but the results are not consistent.

How could I do it?

Thanks a lot.

1 ACCEPTED SOLUTION  Community Support

I suggest you to add [Historical Q V/H] measure as a column in a virtule table. And then count the Agent by filter [Historical Q V/H] in that table.

``````Q4 Count =
VAR _Historical_Q_VH =
ALL ( 'Times Integrated Marker Advisor' ),
"Historical Q V/H",
IF (
AND (
SELECTEDVALUE (
) = "Historical",
),
"Q4",
IF (
AND (
OR (
SELECTEDVALUE (
) = "Historical",
),
),
"Q3",
IF (
AND (
OR (
SELECTEDVALUE (
) = "Historical",
),
),
"Q2",
IF (
AND (
SELECTEDVALUE (
) = "Historical",
),
"Q1",
""
)
)
)
)
)
RETURN
COUNTX ( FILTER ( _Historical_Q_VH, [Historical Q V/H] = "Q4" ), [Agent] )``````

Best Regards,
Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 REPLIES 4  Good afternoon.

The result he shows me is the same, but it is not reality.

The table is as follows: And I create 7 measures for each value in the Level 1 field:

An example:

Now I want to make a count of each of the 7 measurements, whose values are always Q1,Q2,Q3 and Q4.
I will have to do a total of 28 counting measures (7x4) to be able to know how many advisors there are with the Q1 of Level 1 = Historica for example.
Thanks a lot.  Super User

Q4 Count = Countx(FILTER(VALUES('Times Integrated Marker Advisor'[Agent]),'Times Integrated Scoreboard Advisor'[Historical Q V/H]="Q4"),[Agent])

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.  Good afternoon.

The result he shows me is the same, but it is not reality.

The table is as follows: And I create 7 measures for each value in the Level 1 field:

An example:

Now I want to make a count of each of the 7 measurements, whose values are always Q1,Q2,Q3 and Q4.
I will have to do a total of 28 counting measures (7x4) to be able to know how many advisors there are with the Q1 of Level 1 = Historica for example.
Thanks a lot.  Community Support

I suggest you to add [Historical Q V/H] measure as a column in a virtule table. And then count the Agent by filter [Historical Q V/H] in that table.

``````Q4 Count =
VAR _Historical_Q_VH =
ALL ( 'Times Integrated Marker Advisor' ),
"Historical Q V/H",
IF (
AND (
SELECTEDVALUE (
) = "Historical",
),
"Q4",
IF (
AND (
OR (
SELECTEDVALUE (
) = "Historical",
),
),
"Q3",
IF (
AND (
OR (
SELECTEDVALUE (
) = "Historical",
),
),
"Q2",
IF (
AND (
SELECTEDVALUE (
) = "Historical",
),
"Q1",
""
)
)
)
)
)
RETURN
COUNTX ( FILTER ( _Historical_Q_VH, [Historical Q V/H] = "Q4" ), [Agent] )``````

Best Regards,
Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.  