cancel
Showing results for
Did you mean:
Highlighted
Anonymous
Not applicable

## DAX Distinct count. Total in table to be sum of distinct counts per row, not total distinct

I want to total for 'count of visitors' to be 4424 as its a unique count.

I tried this but it gives a huge number not even close?

User Distinct =
VAR t =
SUMMARIZE (
'Kepler',
Kepler[Date],
"UserDistinct"DISTINCTCOUNT ( Kepler[Visitors] )
)
RETURN
SUMX ( t, [UserDistinct] )

Any help!

Thanks,

Warren

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft

## Re: DAX Distinct count. Total in table to be sum of distinct counts per row, not total distinct

Hi @Anonymous,

You can try this measure:

```Measure distinct count visitor =
SUMX (
VALUES ( Kepler[Date] ),
CALCULATE ( DISTINCTCOUNT ( Kepler[Visitors] ) )
)```

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Highlighted
Super User IV

## Re: DAX Distinct count. Total in table to be sum of distinct counts per row, not total distinct

Need sample source data in text form that can be copied and pasted. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

---------------------------------------

Putting square pegs in round holes since 1972.

##### I have a NEW book! DAX Cookbook from Packt
Over 120 DAX Recipes!

Proud to be a Super User!

Highlighted
Microsoft

## Re: DAX Distinct count. Total in table to be sum of distinct counts per row, not total distinct

Hi @Anonymous,

You can try this measure:

```Measure distinct count visitor =
SUMX (
VALUES ( Kepler[Date] ),
CALCULATE ( DISTINCTCOUNT ( Kepler[Visitors] ) )
)```

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

## Re: DAX Distinct count. Total in table to be sum of distinct counts per row, not total distinct

Thankyou Yuliana. That's perfect!

Highlighted
Frequent Visitor

## Re: DAX Distinct count. Total in table to be sum of distinct counts per row, not total distinct

Amazing Solution @v-yulgu-msft  !! Thanks so much !!

Announcements

#### August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

#### Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

#### Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors