Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hello
I would like to create a calculated table using DAX, that adds columns from different tables and calulations based off those columns.
I have an Event Table where I would like to use the Event_ID
I have Country Table where I would like to use the Country_ID This has a 1-Many relationship with the Event Table on the Country_ID in voth tables
From a Usage Table I have Event_ID, Country_ID along with some usage data. I would like to do a If statement, if the Event_ID, Country_ID = Event_ID & Country_ID from the calculated table then "Yes", "No"
The table then should look like this
EVENT_ID | COUNTRY_ID | USED |
12345 | 12 | YES |
Thanking you in advance
Solved! Go to Solution.
@Anonymous Maybe:
Table =
SELECTCOLUMNS(
ADDCOLUMNS(
SELECTCOLUMNS('Events',"__EVENT_ID",[Event_ID],"__COUNTRY_ID",[Country_ID]),
"USED",IF(COUNTROWS(FILTER('Usage Table',[__EVENT_ID]=[Event_ID] && [__COUNTRY_ID]=[Country_ID])>0,"YES","NO")
),
"EVENT_ID",[__EVENT_ID],"COUNTRY_ID",[__COUNTRY_ID],"USED",[USED]
)
Thanks Greg, much apprciated
@Anonymous Maybe:
Table =
SELECTCOLUMNS(
ADDCOLUMNS(
SELECTCOLUMNS('Events',"__EVENT_ID",[Event_ID],"__COUNTRY_ID",[Country_ID]),
"USED",IF(COUNTROWS(FILTER('Usage Table',[__EVENT_ID]=[Event_ID] && [__COUNTRY_ID]=[Country_ID])>0,"YES","NO")
),
"EVENT_ID",[__EVENT_ID],"COUNTRY_ID",[__COUNTRY_ID],"USED",[USED]
)