Forum Discussion

kelvinteoh's avatar
kelvinteoh
Regular Visitor
3 years ago
Solved

Help me on Power Bi

Hi everyone,   On here i have 3 points that not really understand how to create it using raw data.  Please help me with this part  thanks.
  • eliasayyy's avatar
    3 years ago

    hello the first part is creating relatiosnhips 

    you have 3 kinds of relationships :

    one to one : you have in both tables 1 primary key (unique id) for each value

    One to Many and Many to one : when you have 1 table that has unique primary key while otehr table has numerous duplicates of the value like making a relationship between calendar table and sales table by the date column

    many to many is when you have multiple values of same data in both tables and no unique key (this relationship should be minimized as possible as it can create circular dependacy and make other relationships inactive)

    its a good practice to always create dim tables which means create a table with unique primry key for each item or date for example like a dim Date table where you have 1 unique date in the whole sheet or dim customer which shows each customer id ,

    for the second part of the question , creating new fields means where all the calculations happens , the measures and calculated columns , i prefer creating measures over calculated columns because they are faster and it is a better practice .
     
    finally ,you have optimization which means hide columns you arent using or sort the data rows so you can better understand them and spot trends easier


    so in a very broa dexample lets say you have 2 tables , sales table that contains 2 columns : date and sales and you have a calendar table that has 1 column Date

    first you createa  realtionship between calendat date and sales date ,

    next you create a measure for example called Total Sales which is Total Sales = SUM('Sales Table'[Sales]) 

    and finally insert in a line chart on the x-axis the date from calendar table and on y -axis insert the emasure Total sales