cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IF
Post Partisan
Post Partisan

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
Super User IV
Super User IV

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
Super User IV
Super User IV

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

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Kudoed Authors