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
Anonymous
Not applicable

Dax to find total Units with out duplicates

Hi Team,

 

Please find the sample data,

 

Item CodeItem DescriptionSales PeriodPromotion NameSales UnitsForecast Units
10000PepsiP12019P12019 A1001325
100012 DISNEYP12019P12019 A290
1000220X16P12019P12019 A600
10019NXT EDPP12019P12019 A125109
10019NXT EDPP12019P12019 B125109
10021A G P12019P12019 A130210
10021A G P12019P12019 B130210
10023A G 50MLP12019P12019 A10196
      
   Total Inc Dup709 
   Actual454 

 

You can see the item codes 10019,10021 are duplicating .I want to find out the Sum of Sales Unts with out duplicates.As you can see the expected result as well in the grid.Can some one suggest me the best DAX formula to achieve this.

 

Thank you

 

5 REPLIES 5
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

You could create a measure using dax below:

Total Inc Dup = 
SUMX (
    SUMMARIZE (
        'Table',
        'Table'[Sales Units],
        "Item Code", DISTINCT ( 'Table'[Item Code] )
    ),
    'Table'[Sales Units]
)

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@v-yuta-msft,

 

Thank you for the reply.

 

Actully the above shown girds are showing the sum of sales units against each item code,so the suggested DAX not applicable.

 

Thank you

@Anonymous ,

 

Could you please give the expected result?

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi Jimmy,

 

Expected result it 494 but im not getting the result in the actual data with your formula.

 

Thank you

Biju

@Anonymous ,

 

I'm afraid I still couldn't understand your requirement, could please explain how to achieve 494 sales total and could you share the complete sample data for further test?

 

Regards,

Jimmy Tao

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.