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
Mareno_123
Helper I
Helper I

unique values of cars per day during the week

Hi everybody.
maybe this will be easy for you but I can't do it.
They drive cars every day. Some of them several times a day.
I want to see how many and only unique cars were in a week. It always shows me the week and I can't set the condition for the day.

unique trouble.png

thank you for helping me

1 ACCEPTED SOLUTION

I found a solution.

Create new column: week

MAX car one day of the week - CALCULATE(DISTINCTCOUNT(table[car]); FILTER(ALLSELECTED('table');' table'[week]-MAX('table'[week])))

View solution in original post

5 REPLIES 5
TomMartens
Super User
Super User

Hey @Mareno_123 ,

 

create a table visual, using the week column from the "base" table.

Create a measure using the DAX function DISTINCTCOUNT like so:

no of unique cars =
DISTINCTCOUNT('base"[car])

 Hopefully, this provides what you are looking for.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi,

the distincount is one thing.

But i need max and min of distincount "car" per week.

weekdistinctcount carsminimum of distinct car during weekmaximum ofdistinct car during week
19434
20757

Hey @Mareno_123 ,

 

I have to admit that I do not understand the business rule that determines the "min" and "max" of unique cars per week, please elaborate more on this.

 

I think it's also helpful if you provide sample data, the way you did for the expected result, and not just as a picture.

 

Regards,

Tom

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Im so sory. Im not good in english, im not good in power bi.

 i try so mamy min and max formulas, but no one work for me because i dont know use filter or comand right.

measure:  unique car = DISTINCTCOUNT('table'[car])

measure MIN: MINX('table';[unique car]) 

or measure max: MAXX('table';CALCULATE(DISTINCTCOUNT('table'[car])))

 

test file:

power bi test file unique cars 

I found a solution.

Create new column: week

MAX car one day of the week - CALCULATE(DISTINCTCOUNT(table[car]); FILTER(ALLSELECTED('table');' table'[week]-MAX('table'[week])))

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.