Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

[Measure]

Hi guys,   I am new into PowerBI, and I am struggling to create a new measure.    In my dataset, I have a column with all type of actions realized throughout the year, and there could be the same...
  • v-zhenbw-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    Sorry for that we don’t understand your requirement  clearly. But we create a sample and find the following ways you can refer.

     

    1. Create a calculate column to calculate the ratio of each row.

     

    every row = DIVIDE('Table'[values],SUM('Table'[values]))

     

     

    2. Then we can create a column to calculate the average ratio of per type of actions.

     

    average ratio per type of action = 
    var x = CALCULATE(SUM('Table'[every row]),FILTER('Table','Table'[actions]=EARLIER('Table'[actions])))
    var y = CALCULATE(COUNT('Table'[actions]),FILTER('Table','Table'[actions]=EARLIER('Table'[actions])))
    return 
    DIVIDE(x,y)

     

     

    If it doesn’t meet your requirement, could you please provide a mockup sample  based on fake data or describe the fields of each tables and the relations between tables simply?

     

    It will be helpful if you can show us the exact expected result based on the tables.

     

    Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

    BTW, pbix as attached.       

     

    Best regards,

     

    Community Support Team _ zhenbw

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