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

How to remove duplicates in calculated column?

I want to remove some duplicates from a calculated column. I want to use this column in a measure in LookupValue() but I get an error "a table of multiple values was supplied where a single value was expected." Upon studying the calculated column I got to know that some rows have duplicates which prevent me from getting the max value in the lookupvalue function. 

1 ACCEPTED SOLUTION

Hi @Zain26,

 

Create measures like below:

Max Count =
CALCULATE (
    MAX ( 'TimeRange Table'[CountofTimeRange] ),
    ALLEXCEPT ( 'TimeRange Table', 'TimeRange Table'[USER] )
)

Peak Time Range =
CALCULATE (
    LASTNONBLANK ( 'TimeRange Table'[TimeRange], 1 ),
    FILTER ( 'TimeRange Table', 'TimeRange Table'[CountofTimeRange] = [Max Count] )
)

Add field [USER] into Columns area of matrix, and add measure [Peak Time Range] into Values section.

1.PNG

 

Best regards,
Yuliana Gu

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

View solution in original post

18 REPLIES 18

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.