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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Matthew
New Member

Dax

Hi, I hope someone can help me to write a Measure in PowerBI to sum the Revenue for the distinct Customers.

 

The sum of the Revenue below is £80. Tom has two Tasks set (a and b), but I only want to sum the Revenue for Tom, i.e. Tom's revenue is £10, James' is £15, etc. The total sum for the Revenues for the distinct Customer should total £50.

 

Hopefully some wiz can advise a suitable answers.

 

Thanks.

 

CustomerTaskRevenue, £
Toma10
Tomb10
Jamesc15
Georged20
Jamese15
Harryf5
Harryg5
1 REPLY 1

@Matthew You can do this by creating two Measures, the first supports the second.

First create the max value

Max = MAX(Table1[Revenue, £])

 

Then you can use SUMX to take that max value by distinct Customer

DistinctSum = SUMX(DISTINCT(Table1[Customer]), [Max])

 

Here is a breakdown of what it looks like in table next to other measures and your columns.

breakdown.JPG


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Kudoed Authors