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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
DW868990
Helper IV
Helper IV

DAX to replace duplicate measure values with BLANK

Hi, 

I have a DAX question I am looking for some advice on - 

I have a simple DAX measure for Total Sales - SUM(Sales[SalesAmount]), in a table with Products like below:

DW868990_0-1691650390372.png

But what I am after is for when the measure returns a duplicate value, for all duplicated values to return BLANK, just wondering how I would need to tweak the measure to get this result. So the end result looks like below. 

DW868990_1-1691650474450.png

Any advice appreciated, thanks in advance. 




1 ACCEPTED SOLUTION

 

Duplicate Measure = 
VAR CurrentAmount = [Total Amount]
VAR CountOfCurrentAmount = 
    CALCULATE(
        COUNTROWS('table (2)'),
        FILTER(
            ALL('table (2)'), 
            'table (2)'[Amount] = CurrentAmount
        )
    )
RETURN
IF(CountOfCurrentAmount > 1, BLANK(), [Total Amount])

 

annonymous1999_0-1691651236286.png

 

if i helped you solve your question please leave a thumbs up and accept as solution

View solution in original post

3 REPLIES 3
eliasayyy
Super User
Super User

hello @DW868990  what do you mean by duplicate value

As in the above example Bannana, Orange and Lettuce all returned 30, so therefore as that value occurs more than once than they should be BLANK.

 

Duplicate Measure = 
VAR CurrentAmount = [Total Amount]
VAR CountOfCurrentAmount = 
    CALCULATE(
        COUNTROWS('table (2)'),
        FILTER(
            ALL('table (2)'), 
            'table (2)'[Amount] = CurrentAmount
        )
    )
RETURN
IF(CountOfCurrentAmount > 1, BLANK(), [Total Amount])

 

annonymous1999_0-1691651236286.png

 

if i helped you solve your question please leave a thumbs up and accept as solution

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.