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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Moni
New Member

How to calculate distinctcount with date and text type

I gotta column with weekending dates and another coulumn with full name, so im trying use DAX to calculate distinct value of each full name with no of weeks, 

 

I'm getting error with full name as text type cannot be used as true/false or text type cannot be used in filter with distinct count.

 

can anyone help me please.

Moni_0-1652777649759.png

I want output to be gareth 2 weeks, Darran 1 week (since 12/11/21 repeating so distinct count)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

JamesFr06_0-1652778553970.pngJamesFr06_1-1652778598861.png

Nbweek = calculate(DISTINCTCOUNT(Weekending[WeekEnding]))
 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

JamesFr06_0-1652778553970.pngJamesFr06_1-1652778598861.png

Nbweek = calculate(DISTINCTCOUNT(Weekending[WeekEnding]))
 

Measures don't have to be wrapped in CALCULATE as the engine does it automatically.

So, the final formula would be:

Nbweek = DISTINCTCOUNT( Weekending[WeekEnding] )

 

Hi @Anonymous 

 

I tried those measures, it calculates distinctcount of weekending but not name, example it shows

 

Darren 7 weeks

Gareth 2 weeks

 

but i expect answer,

 

Daren 2 weeks (since 12/11/2021, 19/11/2021 only two days are ter)

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors