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
JMSNYC
Helper III
Helper III

Sales Ratios Display

Hi.

 

Could you please help with the following problem: I have a FACT table from which I derived a sales ratio measure : Sales / Customers

 

Sales Ratio = divide('FACT'[Sales],DISTINCTCOUNT('FACT'[Customer ID]), that I display in a Pivot Table :

  • Column 1 is yearmonth
  • Last Column ("Total") is Sales Ratio

In the table below, SR=88% in Jan, 124% in. Dec etc ...

 

162c3ce231c12876755b003c32ea8b3d.png

 

Issue comes when I want to show the Sales Ratio for each individual country ... it divides the 88% across countries, while I need the individual SR by yearmonth and by country.

 

Could anyone help me write the proper Measure ?

 

Thank you in advance

1 ACCEPTED SOLUTION
pranit828
Community Champion
Community Champion

Hi @JMSNYC 

For your requirement I would use the below formula to calculate by each country.

SR  = CACLULATE(divide('FACT'[Sales],DISTINCTCOUNT('FACT'[Customer ID]),ALLEXCEPT('FACT','FACT'[Customer ID]))





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

View solution in original post

5 REPLIES 5
v-deddai1-msft
Community Support
Community Support

Hi @JMSNYC ,

 

You can use the following measure:

 

measure1 =
DIVIDE ( SUM ( 'FACT'[Sales] ), DISTINCTCOUNT ( 'FACT'[Customer ID] ) )

 

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

 

Best Regards,

Dedmon Dai

pranit828
Community Champion
Community Champion

Hi @JMSNYC 

For your requirement I would use the below formula to calculate by each country.

SR  = CACLULATE(divide('FACT'[Sales],DISTINCTCOUNT('FACT'[Customer ID]),ALLEXCEPT('FACT','FACT'[Customer ID]))





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
PaulDBrown
Community Champion
Community Champion

@JMSNYC 

 

I'm not sure I'm following you. Your measure will divide the sales for a given country in a given month by the number of customers in that country in that month, which sounds correct. The total is just the total sales by month divided by the customers that month.

So what do you need to calculate? Can you provide. Depiction of the expected result?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi Paul.

 

Thank you for your quick follow-up question. Here is an example

80a4104b76080c257a19e6332f7a422e.png

I would like the measure to compute numbers the way it is described in the Green Table, while today, as per the example, the computing follows the red sample.

Is it more clear? Thank you again for your support.

@JMSNYC 

Again, I'm not sure what is going on at your end. Here is a dummy dataset:

result.JPG

 

If I want to see the number of items divided by the number of customers for each country  by month, the measures are straightforward:

1) Number Items = SUM(FactTable[Items])

2) Number of Customers = DISTINCTCOUNT(FactTable[Customer ID])

3) Items by Customer = DIVIDE([Number Items], [Number of Customers])

 

and you get this:

matrix.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.