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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Super User
Super User

@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!


Regards,
Nandu Krishna

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
Super User
Super User

@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!


Regards,
Nandu Krishna

Thank you @nandukrishnavs 

Much appreciated.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.