Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
dinoscool3
Helper II
Helper II

Conditional Column based on other table

I have a table of registrations and a table of viewers. I would try to add them as a relationship but because of how the data is stored and the number of webinars, registrations, and viewers, I can't get it to work. So I'm wondering if I can find a way this way. (Tables simplified)

 

Registration:

EmailWebinar
georgeburns@gb.comHow to tie shoes
bobhope@bh.comHow to tie shoes
jackbenny@jb.comHow to tie ties
donrickles@dr.comHow to tie ties

 

Viewers:

EmailWatch startWatch endWebinar
georgeburns@gb.com11:1211:15How to tie shoes
bobhope@bh.com11:1011:20How to tie shoes
Georgeburns@gb.com11:2011:30How to tie shoes
jackbenny@jb.com12:1012:30how to tie ties

 

What I want in the registration table:

EmailWebinarWatched
georgeburns@gb.comHow to tie shoesYes
bobhope@bh.comHow to tie shoesYes
jackbenny@jb.comHow to tie tiesYes
donrickles@dr.comHow to tie tiesNo

 

 

 

I think the idea would be:

For each row in the Registartions table:

  1. If a match exists between Registrations[email] and Viewers[email]
    1. If registrations[webinar_id] equals viewers[webinar_id]
      1. Set registrations[watched] to "Yes"
      2. Else set Set registrations[watched] to "No"

Unless I'm missing something here?

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@dinoscool3 

Try adding this as a calculated column in your Registrations table.

Watched = 
VAR _ViewCount = 
CALCULATE (
    COUNTROWS ( Viewers ),
    TREATAS (
        CALCULATETABLE (
            SUMMARIZE ( Registrations, Registrations[Email], Registrations[Webinar] )
        ),
        Viewers[Email],
        Viewers[Webinar]
    )
)
RETURN IF ( _ViewCount > 0, "Yes", "No" )

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

@dinoscool3 

Try adding this as a calculated column in your Registrations table.

Watched = 
VAR _ViewCount = 
CALCULATE (
    COUNTROWS ( Viewers ),
    TREATAS (
        CALCULATETABLE (
            SUMMARIZE ( Registrations, Registrations[Email], Registrations[Webinar] )
        ),
        Viewers[Email],
        Viewers[Webinar]
    )
)
RETURN IF ( _ViewCount > 0, "Yes", "No" )
amitchandak
Super User
Super User

@dinoscool3 ,

New column Registration =

var _1 = Maxx(filter(Viewers, Viewers[Email] =Registration[email]), Viewers[Email])

return

if(isblank(_1), "No", "Yes")

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

When I try to do this, I can't add in the registration email in the filter, it only lets me add in values from the viewers table.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.