Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hedgy123
Frequent Visitor

Average vs. sum in a measure for a matrix roll up/roll down

Hi,

  

   I am trying to figure out how to best display the order rates  (number of orders divided by the number of clicks) per customer per product.  To illustrate the problem, consider just one customer and 3 products, and let's suppose their order rates for those products in a given time period are 50%, 20%, and 10% because they ordered 2 products out of 4 clicks, 1 out of 5, and 1 out of 10, respectively.  

  

    I calculate this measure:

    

   ClickRate = 100*CALCULATE(SUM(Query['Purchases']))/CALCULATE(SUM(Query['Clicks']))

 

and it shows this:

 

                            Time Period 

CustomerA            

   product1             50

   product2             20 

   product3             10 

 

  which is fine.

 

 But then when I roll it up to CustomerA as a whole, the measure calculates 21%, which is 100*(2+1+1)/(4+5+10).  What I want instead is the average of those per-product purchase rates, so (50+20+10)/3 = 27%.   But I don't know if it's possible to do different measures depending on roll up/roll down levels in a matrix?  Or is there another solution?

 

   Thank you!

 

 

1 REPLY 1
v-yuaj-msft
Community Support
Community Support

Hi @hedgy123 ,

 

Based on your description, I'm not clear to your data model. Could you please share some sample data and the expected result to have a clear understanding of your question? I can do some tests for you.

You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.(Or screenshot of your data table)

 

Best Regards,

Yuna

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.