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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

avoid double count, power query equivalent for excel solution?

Hello,

 

I'm trying to find an equivalent or alternative solution for below excel example. Column B containts the (original) quantities, column C the calculated ones, where the value is set to 0 (zero) where the ID in column A already occurs earlier in previous rows. (the outcome in cell C8 is 0), same as the cell above. 

the totals in cells B9 and C9 are only for illustration purposes and are not needed as such. 

avoid double count.JPG

 

 

 

 

 

 

 

 

 

I'd posted this question earlier attempting to explain what I need in power bi, but without this excel reference. I hope this both clarifies what I'm after and triggers a solution. 

 

thanks,

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

In Power BI, before any transformation,

firstly you could go to Home->Edit queries,

Add column->add an index column from 1,

Then close&&apply and return to Report view, 

Create measures

Measure = CALCULATE(MIN(Table1[Index]),ALLEXCEPT(Table1,Table1[id]))

Measure 2 = IF(MAX(Table1[Index])=[Measure],SUM(Table1[q]),BLANK())

5.png

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

In Power BI, before any transformation,

firstly you could go to Home->Edit queries,

Add column->add an index column from 1,

Then close&&apply and return to Report view, 

Create measures

Measure = CALCULATE(MIN(Table1[Index]),ALLEXCEPT(Table1,Table1[id]))

Measure 2 = IF(MAX(Table1[Index])=[Measure],SUM(Table1[q]),BLANK())

5.png

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.