Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
I need to write a code to that counts all the distinct text values from column A, with a text value "to monitor" in column B. However, if the value repeats in the column A, one time with text value in column B = "to repair" and another time with = "to monitor", then it should not be calculated in.
@AndreaSo , Try a measure like
Measure =
var _cnt =
FILTER(
summarize(
FILTER(
'Table',
'Table'[ColumnB] = "to monitor"
),
'Table'[ColumnA]
),
calculate(
distinctcount('Table'[ColumnB]),
'Table'[ColumnA] = EARLIER('Table'[ColumnA])
) = 1
)
return
countrows(_cnt)
User | Count |
---|---|
97 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |