We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 15 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 63 | |
| 37 | |
| 34 | |
| 22 |