Countif in power query

aboly8000

Board Regular
Joined
Sep 4, 2019
Messages
59
Hello
How do I execute the following code in Power Query?
Code:
[FONT=monospace]=IF(COUNTIF($B$2:B2,B2)=1,1,0)[/FONT]
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
[h=2]I'm trying to do this in Power Query

1. Excel PivotTable Count Unique Items pre 2013[/h][FONT=&quot]Pre Excel 2013 you need to use a workaround, which is this:[/FONT]


  1. [*=1]Add a helper column to your raw data with a formula that counts a 1 for the first instance of the product, and a zero for any duplicates.
[FONT=&quot]
pivottable_unique_count_2.png
[/FONT]

[FONT=&quot]In cell E2 I entered this formula:[/FONT]
=IF(COUNTIF($B$2:B2,B2)=1,1,0)
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top