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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
faisayed
Frequent Visitor

Table Relationship

Hi

 

I have 2 tables, Table A comes from database, and Table B comes from Google Analytics. Table A has the total number of registration Country, Device and Source wise, and Table B has total number of users Country, Device and Source wise. I have a line graph that shows the last 7 days  rolling avearge registration rate, formula for which is "total number of registraton" (From Table A) divide with the "total number of users" (From Table B).

 

I want to add 3 more metrics to my dashboard

1. Registration Source wise

2. Registration Country wise

3. Registration Device wise.

 

I want the formula to work in such a way that it divides the total number of particular source e:g google with total number of registrations done through google and so on. and this should apply to Device and source as well.

 

What is the best way to do this. What all relationship should be created to get the end result..

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@faisayed , You need to create common country, source, use, and date table, and then you can create rolling measure using the date table

 

Rolling 7 = CALCULATE(Sum(Table1[Reg Count]) ,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,DAY))

 

 

Rolling 7 user= CALCULATE(Sum(Table2[User Count]) ,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,DAY))

 

 

 

refer

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solutio...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@faisayed , You need to create common country, source, use, and date table, and then you can create rolling measure using the date table

 

Rolling 7 = CALCULATE(Sum(Table1[Reg Count]) ,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,DAY))

 

 

Rolling 7 user= CALCULATE(Sum(Table2[User Count]) ,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-7,DAY))

 

 

 

refer

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solutio...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank You @amitchandak for quick response and excellent workaround for my problem. 

I got the outcome i was looking for.👍

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.