cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jos13
Helper III
Helper III

Sum Distinct Values

Hi Team,

 

I have the following data.

Jos13_0-1608044595556.png

I want to create a measure that calculates Customer A's sale as 100 when user selects Jan 1 on slicer and 220 if user selects date range between 1st and 2nd Jan.

I tried taking the sum of averages, but it didn't work.

Please help me on this.

 

 

Regards,

Jos 

1 ACCEPTED SOLUTION
nandukrishnavs
Community Champion
Community Champion

@Jos13 

 

Try the below DAX measure.

 

Measure1 =
VAR _x =
    SUMMARIZE ( 'Table', 'Table'[Date], 'Table'[Customer], 'Table'[Sale] )
VAR _sum =
    SUMX ( _x, [Sale] )
RETURN
    _sum

 

nandukrishnavs_0-1608045589644.png

 

nandukrishnavs_1-1608045622075.png

 




Regards,
Nandu Krishna

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 👍

Proud to be a Super User!

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

that solution worked for me, it's very good, and it's the equivalence of "DISTINCT" in SQL

nandukrishnavs
Community Champion
Community Champion

@Jos13 

 

Try the below DAX measure.

 

Measure1 =
VAR _x =
    SUMMARIZE ( 'Table', 'Table'[Date], 'Table'[Customer], 'Table'[Sale] )
VAR _sum =
    SUMX ( _x, [Sale] )
RETURN
    _sum

 

nandukrishnavs_0-1608045589644.png

 

nandukrishnavs_1-1608045622075.png

 




Regards,
Nandu Krishna

Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 👍

Proud to be a Super User!

View solution in original post

Thank you @nandukrishnavs 

Much appreciated.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors