Forum Discussion
Nicolejclew
Jun 26, 2021Copper Contributor
How to find unique count?
I wanted to churn out unique individual visited my store broken down by month. When I use pivot table, distinct count, it gives me the unique individual for that particular month only. Would lik...
SergeiBaklan
Jun 26, 2021Diamond Contributor
That could be done using DAX measures, result is
I guess you have dates in your source, not just month names. To work with dates in data model it's strongly recommended to use Calendar (aka Date table), otherwise things could be overcomplicated.
You may create it directly in Power Pivot, set relationship with your table
With that measure could be
New Distinct Visitors:=VAR prevVisitors =
CALCULATETABLE (
VALUES ( Table1[Visitor] ),
PREVIOUSMONTH ( 'Calendar'[Date] )
)
VAR thisMonthVisitors =
VALUES ( Table1[Visitor] )
RETURN
COUNTROWS (
EXCEPT (
thisMonthVisitors,
prevVisitors
)
)
Creating PivotTable in rows use months from Calendar table, not from your one