Forum Discussion

heetu24's avatar
heetu24
Icon for Helper I rankHelper I
2 years ago
Solved

Total Average Price of Category

Hello, I am looking for one help in below scenario.

Average Price  = Sales Value/ sales Volume *100

 

I want to  create the  table as per below screen shot . And looking for column  "Average price of Category" as per  below Excel screen shot by DAX as  Measure.

There is only one Category that's why it is same number in  "Average price of Category" column in below screen shot.

 

Note: This is the dummy/sample data.

 

Brand CategoryAverage Price Of BrandAverage price of Category
Ax6.434.9
Bx10.114.9
Cx24.124.9
Dx15.164.9
Ex174.9

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, heetu24 
    Thanks for the quick reply.
     

    I offer two options for your needs:

     

    1.Create calculated column references:

    Column = ('Table'[Average Price Of Brand]/'Table'[Average price of Category])*100

    2. Below are the measure I've created for your needs:

    Measure = (SUM('Table'[Average Price Of Brand])/SUM('Table'[Average price of Category]))*100

    3.Here's my final result, which I hope meets your requirements:

    Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

     

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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

4 Replies

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

    Do not include sensitive information or anything not related to the issue or question.

    If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from lbendlin , please allow me to provide another insight:

    Hi, heetu24 

    Regarding the issue you raised, my solution is as follows:

    1.First I have created the following table and the column names and data are the data you have given:

    2. Below we've given you two measures:

     

    Measure1 = AVERAGEX(ALL('Table'),'Table'[Average Price Of Brand])
    Measure2 = CALCULATE(AVERAGE('Table'[Average Price Of Brand]),ALL('Table'))

     

    3.If you need a total value, we recommend converting the measure to a calculated column and then modifying the aggregation type:

     

    4.Here's my final result, which I hope meets your requirements.

    5.Here is the relevant documentation:

     AVERAGE function (DAX) - DAX | Microsoft Learn
    AVERAGEX function (DAX) - DAX | Microsoft Learn
    ALL function (DAX) - DAX | Microsoft Learn
    ALLSELECTED function (DAX) - DAX | Microsoft Learn
     

    Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

     

    Please find the attached pbix relevant to the case.

     

    Best Regards,

    Leroy Lu

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

     

    • heetu24's avatar
      heetu24
      Icon for Helper I rankHelper I

      Hi, Thank you for your help.

       

      In the Average Price of the toal Average is 72.82. That 72.82 I am looking in seperate column row by row. That is Average Price of the category.

       

      Puropose of this is I want to calculate API(Average Price Index)= (Average Price of the Brand/ Average price of the category)* 100.

       

      Categoty is only one so Average Price of the category will be same.

       

      Looking forward to hear from you

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi, heetu24 
        Thanks for the quick reply.
         

        I offer two options for your needs:

         

        1.Create calculated column references:

        Column = ('Table'[Average Price Of Brand]/'Table'[Average price of Category])*100

        2. Below are the measure I've created for your needs:

        Measure = (SUM('Table'[Average Price Of Brand])/SUM('Table'[Average price of Category]))*100

        3.Here's my final result, which I hope meets your requirements:

        Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

         

        Please find the attached pbix relevant to the case.

         

        Best Regards,

        Leroy Lu

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