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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculate the result of an existing measure based on column from a related table

Good morning

 

I have a two tables

 

Content and Downloaded Content, they have a One to Many relationship

 

I have created a measure called [total content created]. I would like to use this measure to find out how many pieces of content haven't been downloaded. 

 

I have been trying to use the Related function, but to no avail. It's asking me for a column name.

Content Not Downloaded = Calculate([Content Created], KEEPFILTERS(dim_content[content_id] <> RELATED(

 I also tried this 

Content Not Downloaded = Calculate([Content Created], KEEPFILTERS(fact_download[content_id] <> RELATED(dim_content[content_id])))

I get this error The column 'dim_content[content_id]' either doesn't exist or doesn't have a relationship to any table available in the current context.

where am I going wrong?

Thanks

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Related is = . How it not equal to will work. Try like

 

 

 

Content Not Downloaded = Calculate([Content Created], Filter(fact_download, not fact_download[content_id] in value(dim_content[content_id])))

 

 

 

 

 

 

Content Not Downloaded = Calculate([Content Created], Filter(fact_download, not fact_download[content_id] in value(dim_content[content_id])), removefilters(dim_content[content_id]))

 

 

 

 

You might need independent table

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

View solution in original post

johnt75
Super User
Super User

Try

Content not downloaded = CALCULATE( [Content Created], EXCEPT( VALUES(dim_content[content_id]), VALUES( fact_download[content_id])))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you @amitchandak  & @johnt75 both worked,

johnt75
Super User
Super User

Try

Content not downloaded = CALCULATE( [Content Created], EXCEPT( VALUES(dim_content[content_id]), VALUES( fact_download[content_id])))
amitchandak
Super User
Super User

@Anonymous , Related is = . How it not equal to will work. Try like

 

 

 

Content Not Downloaded = Calculate([Content Created], Filter(fact_download, not fact_download[content_id] in value(dim_content[content_id])))

 

 

 

 

 

 

Content Not Downloaded = Calculate([Content Created], Filter(fact_download, not fact_download[content_id] in value(dim_content[content_id])), removefilters(dim_content[content_id]))

 

 

 

 

You might need independent table

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.