I've done a lot of searching for the right answer and i can't seem to find what i'm after.
I have 2 tables in Power BI.
Table A shows the year, companies and products with a column that joins the company and product numbers together.
Table B is similar to the first table but is for a different year. In this table i do a countif to see if that company & product were seen in the year before. In Excel using
=COUNTIF(TableA[[#All],[ComProd]],[@ComProd])
Is there a similar process I can use in the PowerBI DAX/query editor to replicate this?
I've tried creating a custom column with the following in the hope that it works (it does not) -
if [ComProd] = #"TableA"[ComProd] then 1 else 0
I've also tried the following in the advanced editor:
= Table.AddColumn (
"Count", each
Table.RowCount(Table.SelectRows(
#"TableA",
each [ComProd] = [ComProd])))
But this gives me an error :
Expression.Error: 2 arguments were passed to a function which expects between 3 and 4. Details: Pattern= Arguments=[List]
Any help would be so helpful.
Thanks
ComProd
and count how many rows there are in each joined table. – Alexis Olson