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

Table expansion measure

This is an example of the model I have. All filters direction across tables are setted as bidirectional in order to trying to get work my measure:

 

Duda SS.png 

From TypeM table I want to show the SumAmt. The problem is when I'm trying to show the SumAmt by date.

I'm dealing with table expansion but I can't make it work. Reading this book, as Marco and Alberto Pointed "from the farthest table from the fact table to the nearest one", I'm using this measure:

 

 

Sum of Amount= CALCULATE(  SUM(TypeM[SumAmt]); CALCULATETABLE(TypeM;Calendar;Delegat;Customer;Solution)
          )

 

 

But I'm not having the expected result:

 

TypeM.png

 

Having selected Model1 for simplicity, I'm getting this:

sumRes.png

How can I get the right total?

 

Edit: I'm attaching a sample PBIX: This PBIX 

1 ACCEPTED SOLUTION


@Anonymous wrote:

At the end, the expected result in the last table should be:

 

MonthName| Year | Sum of Amt

Sept               2019            5

Feb                 2020            5

Total             |                    10

 


Your data model does not look correct to try and get that sort of result. 

 

Your date is linked to the amount through a many to many (m2m) relationship. The typical example of a m2m relationship is a joint bank account. If you have a husband and wife with a joint bank account and there is $10 in that account when you list the account balance by person you would see the following:

 

Husband  $10

Wife         $10

Total        $10

 

So the huband and wife cannot both spend $10, if the husband spends $10 there will be 0 left in the account.

 

This is the way you have modelled your dates against the TypeM table. If you are saying that Model1 had $5 of sales in Sep 19 and $5 sales in Feb 2020. Then there should be a DateID column in the TypeM table and a row for each month against Model1. If you do this then the 2 months will naturally aggregate and you will get a total of $10.

View solution in original post

3 REPLIES 3
v-xuding-msft
Community Support
Community Support

Hi @Anonymous ,

Can you please show the expected results? You could reference the blog firstly. Hope it can help you.

Expanded tables in DAX 

 

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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-xuding-msft 

 

Thanks for the reference. The problem is that is not possible to reference from calendar table to the other table with an inactive relation. At the end, the expected result in the last table should be:

 

MonthName| Year | Sum of Amt

Sept               2019            5

Feb                 2020            5

Total             |                    10

 

Thanks in advance!


@Anonymous wrote:

At the end, the expected result in the last table should be:

 

MonthName| Year | Sum of Amt

Sept               2019            5

Feb                 2020            5

Total             |                    10

 


Your data model does not look correct to try and get that sort of result. 

 

Your date is linked to the amount through a many to many (m2m) relationship. The typical example of a m2m relationship is a joint bank account. If you have a husband and wife with a joint bank account and there is $10 in that account when you list the account balance by person you would see the following:

 

Husband  $10

Wife         $10

Total        $10

 

So the huband and wife cannot both spend $10, if the husband spends $10 there will be 0 left in the account.

 

This is the way you have modelled your dates against the TypeM table. If you are saying that Model1 had $5 of sales in Sep 19 and $5 sales in Feb 2020. Then there should be a DateID column in the TypeM table and a row for each month against Model1. If you do this then the 2 months will naturally aggregate and you will get a total of $10.

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.