Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
Is it possible to calculate distinct count in the measure below? Here is my measure as it stands, which counts the values but I would like to do distinct count of the values.
Measure1= VAR __table = SUMMARIZE('Table1','Table1'[year],"__value",[Measure2]) RETURN IF(HASONEVALUE('Table1'[year]), [Measure2],COUNTX(__table,[__value]))
E.g. here is measure 2 in action in table visual, which gives measure1 = 4, but I would like measure1 to be 3 in this case.
Year | Measure2 |
2015 | 5 |
2016 | 7 |
2017 | 7 |
2018 | 8 |
Solved! Go to Solution.
See if an adaptation of something like below works:
Measure = VAR __table = SUMMARIZE('Table2','Table2'[UniqueID],"__value",[Measure2) VAR __values = DISTINCT(SELECTCOLUMNS(__table,"__value",[__value])) RETURN COUNTROWS(__values)
See if an adaptation of something like below works:
Measure = VAR __table = SUMMARIZE('Table2','Table2'[UniqueID],"__value",[Measure2) VAR __values = DISTINCT(SELECTCOLUMNS(__table,"__value",[__value])) RETURN COUNTROWS(__values)
Thanks @Greg_Deckler that works 🙂 Is it possible to ignore blanks? i.e. not count the rows where values are blank?
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |