cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper III

## Sum Distinct Values

Hi Team,

I have the following data.

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.

Regards,

Jos

1 ACCEPTED SOLUTION
Community Champion

Try the below DAX measure.

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

Regards,
Nandu Krishna

Appreciate with a kudos 👍

Proud to be a Super User!

Regards,
Nandu Krishna

3 REPLIES 3

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

Community Champion

Try the below DAX measure.

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

Regards,
Nandu Krishna

Appreciate with a kudos 👍

Proud to be a Super User!

Regards,
Nandu Krishna

Helper III

Thank you @nandukrishnavs

Much appreciated.

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors