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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
1up
Helper III
Helper III

DISTINCT function throws error: *Calculation error in measure'

Hi, I'm trying to find the unique values of a column in a table using DISTINCT function.

 

However when I try to visualize the result in a Table, the following error is thrown: 

 

'Calculation error in measure. A table of multiple values was supplied where a single value was expected'.

 

I have a list of machine names. And would like to count how many there are of each name. Each machine name also has a machine ID which is unique. So I'd like to calculate the amount of Machine IDs for each Machine Name. Thus I tried the DISTINCT function.

 

Ideas? Perhaps there could be multiple solutions to the same problem.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@1up , try

distinctcount(Table[Machine ID])

View solution in original post

4 REPLIES 4
v-xuding-msft
Community Support
Community Support

Hi @1up ,

If the formulas that amitchandak and az38 suggested work, please accept them answers as solutions.

 

If you are still confused about the error, please share the sample data, the formula that you tried and your expected result. Then we will understand clearly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@1up , try

distinctcount(Table[Machine ID])

Thank you, DISTINCTCOUNT did the trick!

 

Any ideas why DISTINCT-function is returning an error? Perhaps it needs to be used with another argument?

az38
Community Champion
Community Champion

hi @1up 

you can just summarize values by adding its into visual as a columns or create a calculated table like

New Table = SUMMARIZE(Table,
Table[Machine Name], "Count Unique ID", COUNT(Table[Machine ID])
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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