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
EsterBR
Helper II
Helper II

DAX function to SUM wothout duplicates

Hi,

 

I have a table and I had to unpivot some columns as a result some values have been duplicated in Sales Category. Is there any Dax function to avoin to sum sales category 3 times so when a I sum Sales category by category in a table sums 300 and not 900? Thank you so much

 

EsterBR_0-1705361047819.png

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@EsterBR 

why not use max or min to only get 300?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
v-jiewu-msft
Community Support
Community Support

Hi @EsterBR ,

If I understand correctly, the issue is that you want to sum Sales category without duplicates. Please try the following methods and check if they can solve your problem:

1.Go to the Modeling tab and select New Measure.

 

2.Create a measure using the sumx and distinct functions. Enter the following DAX formula.

Sum Without Duplicates =
SUMX(
    DISTINCT('Table'[Sales Category]),
    CALCULATE(SUM('Table'[Sales Amount]))
)

 

3.Using the measure in the report to sum the sales amount.

 

Looking forward to your reply.

Best Regards,

Wisdom Wu

Thanks,  but unfortunately it does not work:

EsterBR_0-1705393990572.png

EsterBR_1-1705394032073.png

 

 

 

 

vicky_
Super User
Super User

Could you ignore the Sales Category Number and just use the Sum of Sales Category when you go to build your visual -

vicky__0-1705366125939.png

this is assuming that the sub-category isn't missing any Sales figures.

ryan_mayu
Super User
Super User

@EsterBR 

why not use max or min to only get 300?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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