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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
sandeep_sharma
Helper II
Helper II

sum the revenue of distinct value only

I need to sum the revenue for cases that have "Over 90 days" status in status column. The challange here is that I have ticket numbers multiple times in first column. I want to sum only once for one ticket number. I dont want to remove duplicates hence need a dax....Please help

 

sandeep_sharma_0-1678784604756.png

 

7 REPLIES 7
Ahmedx
Super User
Super User

write three measures, like this
Screen Capture #631.pngScreen Capture #632.pngScreen Capture #633.png

Anonymous
Not applicable

Hi  @sandeep_sharma ,

 

Here are the steps you can follow:

1. In Power Query -- Add Column – Index Column – From 1.

vyangliumsft_0-1679037006946.png

2. Create measure.

Flag1 =
var _groupmin=
MINX(
    FILTER(ALL('Table'),
    'Table'[Ticket No.]=MAX('Table'[Ticket No.])&&'Table'[Revenue]=MAX('Table'[Revenue])&&
    'Table'[status]=MAX('Table'[status])),[Index])
var _if=
IF(
   MAX('Table'[Index])= _groupmin,1,0)
return
_if
Flag2 =
SUMX(
    FILTER(ALL('Table'),'Table'[status]="over 90 days"&&[Flag1]=1),[Revenue])

3. Result:

vyangliumsft_1-1679037006948.png

If I have misunderstood your meaning, please provide your desired output and your pbix file without privacy information.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Ahmedx
Super User
Super User

what does the measure show?

It shows 1887006 which is the sum of 875 twice

 

sandeep_sharma
Helper II
Helper II

thanks @Ahmedx for quick response...but not sure why this is not working in my sheet.....

@sandeep_sharma , Try like

 

Sumx(Summarize(Filter(Table, Table[Status]= "over 90 Days"), Table[Ticket No], Table[Revenue]), Table[Revenue])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Ahmedx
Super User
Super User

Screen Capture #563.png

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors