cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tomasjurasek New Member
New Member

Calculating data between relations

Hi,

 

I have some questions about how calculate some data from different tables. 

For example i have relationship  1:M (Gym:Classes) and 1:M (Classes: Booking)

And i want gyms which have some booking in last 7/14 days.

 

What is good to use? Dax, UI?

 

Thanks

2 REPLIES 2
Super User
Super User

Re: Calculating data between relations

Basic format is:

 

MyColumn = CALCULATE(SUM('Table'[Column]),RELATEDTABLE('Table'))

This would SUM the "Column" in Table but only for the related records from Table that relate to the particular row in the context of which this formula executes.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Community Support Team
Community Support Team

Re: Calculating data between relations

Hi @tomasjurasek,

 

Can you share some detail content of your struct?

 

BTW, I'd like suggest you add a calculated column to store the gym info, then you only need to deal with the specify date range.

 

Measure:

 

IsBooking Last 7 days = IF(COUNTROWS(FILTER(ALL(Booking),[Date]>= TODAY()-7&&[GYM ID]=MAX([GYM ID])))>0,TRUE(),FALSE()) 

 

 

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)