Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Power bi modeling( Star or snowflake)

can anyone help me to change the model or show me where went wrong to show actual results.

amitchandak Greg_Deckler az38 

I have below model from my practice data.

data contains total 20 transactions and their product type , brand.

Not all 20 transactions contains agreements and offices.

 

when i inlcude transactions with instalment (sum of amount+instalment date), branches ... report is showing only non blank branch and agreement transactions..im missing transactions which does not have agremments,branches ,which has instalment entries.

 below are two requirements in test cases.

1)

Transaction idit should list all available transactions
praduct type idit should list product type of transaction
brand nameit should show brand of transaction
agreement id

it should show all agreements associated with transaction

if no agreement is available it should show blank

branch id

it should show all branches associated with transaction(Through agreement)

if no branch is available it should show blank

instalment amountsum of instalments amount
instalment datedate of instalment

 

My output: it showing only non blank branch and agreement transactions with their instalments ,intalment date.

expected output: should list all transactions

error : Im missing some transactions which contains blank agreement and its branches.

 

2)

Transaction idshould list all available transactions
agreement nameshould show respective agreement,if no agreement is available it has to be blank
branch idshould show respective branch(through agreement),if no branch is available it has to be blank

 

Expected output : it should list all transaction

output : Error in visual

 

below is pbix ondrive link

https://1drv.ms/u/s!Asxus9sKyugxaZy9vrUQO7uPQCI?e=am8SNq

below is the data

https://1drv.ms/x/s!Asxus9sKyugxanE9I00kIonmE78?e=QUwAer

 

  • az38's avatar
    az38
    6 years ago

    Anonymous 

    sorry πŸ™‚ are you sure you need transactionId as third column in visual, not the first?

  • az38's avatar
    az38
    6 years ago

    Hi Anonymous 

    there is solution with Query Editor in the attach

    Drop relationships branch-agreement and installment-transaction

    Merge Transaction and branch tables

    Merge transaction and installment tables

     

     

     

7 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    finally, you have Branch-Transaction many-to-many relationships by agreement_id field

    How do you want to solve this amigious? Agreement table won't help you there

    • Anonymous's avatar
      Anonymous
      Not applicable

      az38 ,

       

      This is a kind of challenge to me.

       

      I got a solution by left joining transaction table with agreement (left joining agreement with office), It gives me all list of transactions with their agreements and offices,blank agreement and office data for transaction which does not have agreement and office, This is giving me expected result,,,, This leads my model to have a many to many relationship between transaction and instalment table......Im not satified with my approach (model having many to many relationship).... Searching for right approach...

      • az38's avatar
        az38
        Icon for Community Champion rankCommunity Champion

        Anonymous 

        ok. question. First of all, it's a business question. We have to understand business needs in this report

        you have Installment[Amount] for each transaction

        for example 

        Transaction ID Installment[Amount]
        1 10

        But each transaction could have a few branches, for example

        Transaction ID Branch ID
        1 2
        1 3
        1 4

        So, how should be filled field Installment[Amount] for each pair Transaction-Branch in this case?

        Transaction ID Branch ID Installment[Amount]
        1 2 ?
        1 3 ?
        1 4 ?