Forum Discussion
Anonymous
6 years agoNot applicable
Convert new variable in Power Query to a column of table
I have dates in my table A, and I have another list of Dates in another table B. If Date in A = any Date in B, then the column should be 1, else 0 I defined a variable for this - BL_Count = if ...
- 6 years ago
In power query you can do a merge between two tables, and expand table B and then add a custom column, if date of table b column is null then 0 else 1 Assuming after merge the date column from Table B is called TableB.Date
if [TableB.Date] = null the 0 else 1
parry2k
Super User
6 years agoAnonymous you can add a calculated column using following DAX expression in Table A
BI Count =
IF ( TableA[Date] in VALUES ( TableB[Date] ), 1, 0 )
- Anonymous6 years agoNot applicable
Thanks for your quick response! I'm using Excel Power Query Editor, can you give me an equivalent formula in M?
- parry2k6 years ago
Super User
In power query you can do a merge between two tables, and expand table B and then add a custom column, if date of table b column is null then 0 else 1 Assuming after merge the date column from Table B is called TableB.Date
if [TableB.Date] = null the 0 else 1