Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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

 

LayerLimitDeductible
5xs550000005000000
10x101000000010000000

 

Local Table

 

ClaimIncurred
15494849
22025357
374282

 

I want a measure IncurredAboveDeductible, which will substract Incurred from Deductible

ClaimIncurredLayerDeductibleIncurredAboveDeductible
154948495x55000000494849
1549484910x10100000000

 

Kindly help if possible.

 

Thank you.

 

 

@amitchandak  @daxer @parry2k @mahoneypat @AlB @lbendlin @sanalytics

  • Anonymous's avatar
    Anonymous
    5 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

  • What have you tried so far?  How did you connect the two data models?

    • Anonymous's avatar
      Anonymous
      Not 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.

  • Please provide more context. Are you trying to cross join the tables (which doesn't require common columns) ?

    • Anonymous's avatar
      Anonymous
      Not 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]
      )
      )
  • Anonymous's avatar
    Anonymous
    Not 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. 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for taking the time out to try and help me with this! I will go through the blog as well.

      • Anonymous's avatar
        Anonymous
        Not 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