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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MrToast20
Frequent Visitor

Calculated Table - Many To Many issue

Hi there,

 

I have tables in powerbi as follows

 

Premiums Table

 

AmountReport DateCategory
1200.0031/07/2021HAULAGE
500.0030/06/2021TAXI
2356.0031/07/2021VAN

 

Claims Table

 

Amount PaidAmount OSReport DateCategory
0031/07/2021TAXI
1001000

31/07/2021

HAULAGE
50000

30/06/2021

HAULAGE

 

Category Table

TAXI
VAN
HAULAGE
 

 

The claims and Premium table have a 1 to many relations with the Category table

 

I have created a new table to obtain unique dates using the follwing DAX

Report_Dates = CALCULATETABLE ( DISTINCT ( Premium[Report_Date]))
 
When I try to create a relaship between Report_Dates and Premiums and/or claims tables I get a many to many warning. 
 
The report dates table now contains unique values so I am not expecting a many to many error.  
 
Any ideas what I am missing here?

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

You should create a calendar table with unique consecutive date values covering the range of dates in your model and join in a 1-many relationship with the premium and claims table. You the use the calendar table in your measures, filters, slicers etc...





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @MrToast20,

AFAIK, current power bi data model allows to active one major relationships of these relationships will cause a conflict of power bi analysis/aggregations between these records.

Relationships in analysis services tabular models  

In addition, I'd like to suggest you take a look at the following link about star schema relationship designs if helps:

Understand star schema and the importance for Power BI - Power BI | Microsoft Docs
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
PaulDBrown
Community Champion
Community Champion

You should create a calendar table with unique consecutive date values covering the range of dates in your model and join in a 1-many relationship with the premium and claims table. You the use the calendar table in your measures, filters, slicers etc...





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






selimovd
Super User
Super User

Hey @MrToast20 ,

 

how does the table look? Are there multiple values?

Why don't you just create a dimensional date table with the CALENDAR function?

Check here how to do that:

https://softcrylic.com/blogs/power-bi-for-beginners-how-to-create-a-date-table-in-power-bi/

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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