Forum Discussion
Custom column that counts rows from other table
- 4 years ago
Hi kroman
You can create a new calculated column for AllFiles and calculate the number of URLs that coincide with FilesAccessed. See if you can solve your problem.
Column = CALCULATE ( DISTINCTCOUNT ( FilesAccessed[URL] ), FILTER ( 'FilesAccessed', 'FilesAccessed'[URL] = EARLIER ( 'All Files'[URL] ) ) )If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?
Best Regards
Community Support Team _Charlottez Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Done it via "Modeling" > "New Column" but getting blank fileds, although there is some values in Search
Have you checked those Url that have blank? is there any value in FilesAccessed table for those Url?
Try this if there is Url for them:
NewColumn =
CALCULATE (
COUNTROWS ( FilesAccessed ),
FILTER ( all(FilesAccessed) , FilesAccessed [Url] = AllFiles[Url] )
)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
- kroman4 years ago
Helper II
Tried it - same result 😕
Checked values in Url columns in both tables - values are there- VahidDM4 years ago
Super User
Try this then:
New Column = COUNTROWS ( FILTER ( ALL ( FilesAccessed ), FilesAccessed[Url] = EARLIER ( AllFiles[Url] ) ) )If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
- kroman4 years ago
Helper II
Still the same 😕