Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
IF
Post Prodigy
Post Prodigy

Disctinct count of different values

Hi,

I want to get distinctcount of the values from 6 different columns (C1,C2,C3,C4,C5, and C6). I exclude if the C2 is #. What I do is that I copy those and merge them in one column, named "All".

Measure = CALCULATE(DISTINCTCOUNT('Table'[All]), 'Table'[C2]<>"#")
It works and brings the result as 6 by counting No. 1, 2 and 6 as 1; and excluding no 3, and no 9.  I have quite a lot of data and this way is slowing down the process. When I merge them, they are about 23-26 characters, which doesn't even allow me to use the whole number format. Is there any other way of doing the same without exhausting the memory very much?
 
NoTypeC1C2C3C4C5C6Value
1A113436546664446754543467010
2A123436546664446754543467011
3A13343654666#44677676753467015
4A143436546664322425454346705
5A15343533455244675454346553
6A167675645454444675454346702
7A1734365466644432254543467020
8A1834365466644432254543467030
9A19343654666#446754545544315
10A2034365466644467654324544325

 

 
 
Kind regards
1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You could try using a measure instead like this one (don't create the concatenated column)

 

NewMeasure =
COUNTROWS (
    SUMMARIZE (
        FILTER ( Table, Table[C2] <> "#" ),
        Table[C1],
        Table[C2],
        Table[C3],
        Table[C4],
        Table[C5],
        Table[C6]
    )
)

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

You could try using a measure instead like this one (don't create the concatenated column)

 

NewMeasure =
COUNTROWS (
    SUMMARIZE (
        FILTER ( Table, Table[C2] <> "#" ),
        Table[C1],
        Table[C2],
        Table[C3],
        Table[C4],
        Table[C5],
        Table[C6]
    )
)

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.