Forum Discussion
Division between tables
- Anonymous2 years ago
I would like to thank quantumudit for the valuable input.
Hi game1 ,
Here I will add some details by creating simple data to achieve the desired results.
I have taken the following steps:1.Create simple data.
Table1:
Table2:
2.Create a calendar table:
DateTable = ADDCOLUMNS( CALENDAR(DATE(2024,1,1), DATE(2024,10,1)), "YearMonth", FORMAT([Date], "YYYY-MM") )3.Create relationships as quantumudit describes:
4.Create three measures:
Measure1 = COUNT('Table1'[ClothesID]) Measure2 = SUM('Table2'[Sales]) divide = DIVIDE('Table2'[Measure2],'Table1'[Measure1])5.Use the DateTable's "YearMonth" as a slicer field,and the result is as follows:
Model relationships determine how the data carries out interactions between different tables, and should also follow the principles of the star schema when we model, here are a couple of links that will help you:
Model relationships in Power BI Desktop - Power BI | Microsoft Learn
Understand star schema and the importance for Power BI - Power BI | Microsoft LearnBest Regards,
Zhu
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I would like to thank quantumudit for the valuable input.
Hi game1 ,
Here I will add some details by creating simple data to achieve the desired results.
I have taken the following steps:
1.Create simple data.
Table1:
Table2:
2.Create a calendar table:
DateTable =
ADDCOLUMNS(
CALENDAR(DATE(2024,1,1), DATE(2024,10,1)),
"YearMonth", FORMAT([Date], "YYYY-MM")
)
3.Create relationships as quantumudit describes:
4.Create three measures:
Measure1 = COUNT('Table1'[ClothesID])
Measure2 = SUM('Table2'[Sales])
divide = DIVIDE('Table2'[Measure2],'Table1'[Measure1])
5.Use the DateTable's "YearMonth" as a slicer field,and the result is as follows:
Model relationships determine how the data carries out interactions between different tables, and should also follow the principles of the star schema when we model, here are a couple of links that will help you:
Model relationships in Power BI Desktop - Power BI | Microsoft Learn
Understand star schema and the importance for Power BI - Power BI | Microsoft Learn
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.