Forum Discussion

Matthew's avatar
Matthew
New Member
10 years ago

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.