cancel
Showing results for
Did you mean:
Regular Visitor

## Dax for Get count of distinct rows from measure

my table is below

Column1    Coulmn2

A                     1

A                     1

A                     2

A                     2
A                     2
A                     3

output will be 3 as there are 3 unique rows.

Note: My source is tabular model so i can create only measures in power BI

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Senior Member

## Re: Dax for Get count of distinct rows from measure

Create a calculated column that concatenates Column1 and 2 then distinct count that.

`Count = Table1[Column1 ] & Table1[Coulmn2]`
`DistinctRows = CALCULATE(DISTINCTCOUNT(Table1[Count]))`

Community Support Team

## Re: Dax for Get count of distinct rows from measure

Hi @PR20048119 ,

One sample for your reference. Here we can create a measure as below.

`Measure = SUMX(VALUES(Table1[Column1]),CALCULATE(DISTINCTCOUNT(Table1[Column2])))`

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Senior Member

## Re: Dax for Get count of distinct rows from measure

Request is a little bit vague but a DISTINCTCOUNT([Column2]) should work i believe?

Br,
Johannes

Highlighted
Senior Member

## Re: Dax for Get count of distinct rows from measure

Create a calculated column that concatenates Column1 and 2 then distinct count that.

`Count = Table1[Column1 ] & Table1[Coulmn2]`
`DistinctRows = CALCULATE(DISTINCTCOUNT(Table1[Count]))`

Super User

## Re: Dax for Get count of distinct rows from measure

May be a MEASURE like

`Measure = Countrows(DISTINCT(TableName))`
Community Support Team

## Re: Dax for Get count of distinct rows from measure

Hi @PR20048119 ,

One sample for your reference. Here we can create a measure as below.

`Measure = SUMX(VALUES(Table1[Column1]),CALCULATE(DISTINCTCOUNT(Table1[Column2])))`

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.