Forum Discussion

kroman's avatar
kroman
Icon for Helper II rankHelper II
4 years ago
Solved

Custom column that counts rows from other table

Hi All I have 2 tables: AllFiles (Url (unique) )  and  FilesAccessed (Url, AccessDate) I need to add custom column to AllFiles that would show how many times particular file was accessed. So someth...
  • v-zhangti's avatar
    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.