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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

How I can calculate sum values if me need this sum for unique from another field with filter

Hi everyone! how I can sum PRODSERIE without dublication(for SERIE). Me need get result:  SERIE-1(100) + SERIE-2(300)+SERIE-3(300)=700 for Type=0 and SERIE-4(300)=300 for Type 1;

 

IDSERIEPRODSERIETYPEANOTHER VALUE
1110001
21100050
32300023
423000254
523000234523
633000400
7430011545
843001345345
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try like

sumx(summarize(table,table[SERIE], "_1",maxX(filter(Table, (Table[TYPE]=0 && table[SERIE]<=3) ||
(Table[TYPE]=1 && table[SERIE]=4)) Table[PRODSERIE])),[_1])

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

Try like

sumx(summarize(table,table[SERIE], "_1",maxX(filter(Table, (Table[TYPE]=0 && table[SERIE]<=3) ||
(Table[TYPE]=1 && table[SERIE]=4)) Table[PRODSERIE])),[_1])

Greg_Deckler
Super User
Super User

Try using SUMMARIZE like:

 

Measure =

  SUMX(

    SUMMARIZE('Table',[SERIE],"__Value",AVERAGE([PRODSERIE])),

    [__Value]

  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.