Forum Discussion
Power Bi | Analysis Services | Working with Mixed Model
Hello,
I am working with an Analysis Services Model which works on Live Connection.
With the December Power Bi Update we can add local tables also and make the model mixed.
So in my mixed model, i want to create a measure to substract 2 columns(one from live connection and one from local).
Live Connection Table
| Layer | Limit | Deductible |
| 5xs5 | 5000000 | 5000000 |
| 10x10 | 10000000 | 10000000 |
Local Table
| Claim | Incurred |
| 1 | 5494849 |
| 2 | 2025357 |
| 3 | 74282 |
I want a measure IncurredAboveDeductible, which will substract Incurred from Deductible
| Claim | Incurred | Layer | Deductible | IncurredAboveDeductible |
| 1 | 5494849 | 5x5 | 5000000 | 494849 |
| 1 | 5494849 | 10x10 | 10000000 | 0 |
Kindly help if possible.
Thank you.
@amitchandak @daxer @parry2k @mahoneypat @AlB @lbendlin @sanalytics
- Anonymous5 years ago
Hi Anonymous
You may try make change to live connection mode for Analysis Services to change mode to DirectQuery.
Blog: Using DirectQuery for Power BI datasets and Azure Analysis Services (preview)
Then you can use datasource from live connection and local at the same time.
Try to build a new calculated table.
Table = ADDCOLUMNS(GENERATE('Local Table','Live Connection'),"IncurredAboveDeductible",IF([Incurred]-[Deductible]<0,0,[Incurred]-[Deductible]))Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
7 Replies
- lbendlin
Super User
What have you tried so far? How did you connect the two data models?
- AnonymousNot applicable
Hello,
I have connected to the live connection model. And then added a local table with a SQL Query from Azure Analysis Services.
Just tried creating relationship between my local table and one table from Live Model. Could only create Many-Many and not Many-One like i wanted.
Could not create a relationship between the tables i have posted in my question as there are no matching columns.
- lbendlin
Super User
Please provide more context. Are you trying to cross join the tables (which doesn't require common columns) ?
- AnonymousNot applicable
Thank you, Cross Join worked! I could compute the measure required!
This is my formula>>>
IncurredAboveLayerDeductible = CALCULATE (SUMX (FILTER (CROSSJOIN (DimLayer,SUMMARIZE (FactClaims,FactClaims[Inflated Incurred],FactClaims[Client Claim Reference],FactClaims[Client LOB])),FactClaims[Inflated Incurred] > DimLayer[Deductible]),FactClaims[Inflated Incurred] - DimLayer[Deductible]))
- AnonymousNot applicable
Hi Anonymous
You may try make change to live connection mode for Analysis Services to change mode to DirectQuery.
Blog: Using DirectQuery for Power BI datasets and Azure Analysis Services (preview)
Then you can use datasource from live connection and local at the same time.
Try to build a new calculated table.
Table = ADDCOLUMNS(GENERATE('Local Table','Live Connection'),"IncurredAboveDeductible",IF([Incurred]-[Deductible]<0,0,[Incurred]-[Deductible]))Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thank you for taking the time out to try and help me with this! I will go through the blog as well.
- AnonymousNot applicable
Hi Anonymous
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Rico Zhou