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! Don't miss your chance! Learn more
Hello all,
Fairly new to PowerBi and Query,
Looking for some guidance on how to go about this....
This is my pivot table result within my data model
Example:
| DistinctCount of Words | |
| 1234 | 1 |
| 4566 | 2 |
| 7598 | 1 |
| 1234 | 1 |
| 1234 | 3 |
Im looking for a way to display my distintcount results
| Results of Distinct Count | Count |
| 1 | 3 |
| 2 | 2 |
| >=2 | 2 |
Solved! Go to Solution.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
Test:
You may create measures as below.
DistinctCount of Words = SUM('Table'[Value])Result Measure =
var t =
ADDCOLUMNS(
'Table',
"Re",
[DistinctCount of Words]
)
var tab =
ADDCOLUMNS(
Test,
"Result",
SWITCH(
[Results of Distinct Count],
"1",
COUNTROWS(
FILTER(
t,
[Re]=1
)
),
"2",
COUNTROWS(
FILTER(
t,
[Re]=2
)
),
">=2",
COUNTROWS(
FILTER(
t,
[Re]>=2
)
)
)
)
return
SUMX(
tab,
[Result]
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
Test:
You may create measures as below.
DistinctCount of Words = SUM('Table'[Value])Result Measure =
var t =
ADDCOLUMNS(
'Table',
"Re",
[DistinctCount of Words]
)
var tab =
ADDCOLUMNS(
Test,
"Result",
SWITCH(
[Results of Distinct Count],
"1",
COUNTROWS(
FILTER(
t,
[Re]=1
)
),
"2",
COUNTROWS(
FILTER(
t,
[Re]=2
)
),
">=2",
COUNTROWS(
FILTER(
t,
[Re]>=2
)
)
)
)
return
SUMX(
tab,
[Result]
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Anonymous
you can solve this in DAX by creating a new table using the SUMMARIZE function where you make the distinct count and depending on the output of this, writing in a new column 1, 2 or >=2. Then using this created table in your pivot-table. Here a possible code
CountDistinctCount = SUMMARIZE(YOURTABLE
, YOURTABLE[COLUMNTODISTINCTCOUNT], "CountOfDistinctCount", if (COUNT(YOURTABLE[COLUMNTODISTINCTCOUNT])=1, "1", if (COUNT(YOURTABLE[COLUMNTODISTINCTCOUNT])=2, "2", ">=2")))
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hi @Anonymous ,
I did not get the desired result.
you have 2 and >=2 ?
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 10 | |
| 6 | |
| 5 |