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

Interactions between shared dimensions & fact tables

Hi,

 

I have the following data model : 

simpleCRM.PNG 

 

CRM data 

id_clientactivity_datestakes
223312/12/20213,00
233313/12/20211,00
233314/12/20215,00
111114/12/202110,00

 

Fact table

iddate_dtuniverse_idid_clientleadsmetric_2
111/11/2021111110342
212/12/2021137223310
312/12/2021138111110
412/12/20211Not available02
512/12/20211Not available021

 

Universe_dimension

univers_idsource_idunivers_opening
1376POKER
1386SPORT
16not available

 

I would like to know the sum of Stakes by the univers_opening between the 11 and 14th of December. To do that, I first need to know to which univers_opening each id_client (from the CRM) is associated. As you can see, id_client (fact table) can be duplicated. In this case, I would like to keep the row with the most recent date. 

 

Expected result will look like this :

univers_openingCRM stakes
POKER9
SPORT10
not available0

 

I tried with the following formula :

 

 

CRM stakes = 

CALCULATE(
    SUM(crm[stakes]),
    USERELATIONSHIP(crm[id_client], fact_table[id_client])
)

 

 

 but it's giving me a wrong result:

univers_openingCRM stakes
POKER3
SPORT10
not available10
Total 19

 

I can provide the pbix file if needed.

 

Thank you for your help

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

For your description, what I want to confirm with you is whether 2233 and 2333 are different id types or input errors. Also for your data model, I think you need to create a bridge table between the CRM and Fact tables. Then try again.

vhenrykmstf_0-1643611254682.png


If the problem is still not resolved, please point it out. Looking forward to your feedback.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

For your description, what I want to confirm with you is whether 2233 and 2333 are different id types or input errors. Also for your data model, I think you need to create a bridge table between the CRM and Fact tables. Then try again.

vhenrykmstf_0-1643611254682.png


If the problem is still not resolved, please point it out. Looking forward to your feedback.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @v-henryk-mstf 

2233 and 2333 were input erros. With the same value (2233), my formula is working well... It is my bad.
Thank you about mentioning the bridge tables, I did not know about it. It will be useful for later DAX measures. Thank you !

Hi @Anonymous ,

 

Thank you very much for your feedback.


If the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly.

 

Best Regards,
Henry

 

Anonymous
Not applicable

Hi guys,

 

Does anyone has an idea about how to solve this issue? 

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.