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
GraceTCL
Helper II
Helper II

Top X % of total

Hi

 

I am trying to determine top X % of customers to Sales (GMV) based on this link: https://www.youtube.com/watch?v=jyKAxKSHBTk

Formula works but I am trying to sum the GMV% contribution of these customers and it is not showing the sum but rather 100% as per screenshot.

Appreciate any help to correct my formula below.

Sample file at link: https://www.dropbox.com/s/hkhx0yziyakgtbn/Sample.pbix?dl=0 

 

Capture 2.PNG

Formula:

Top20%MexBrandsByGMV =
if(isblank([GMV USD]),
Blank(),
If(RANKX(all(dmerchant),[GMV USD], ,DESC) <
(CALCULATE([UniqueMexBrands], All(dmerchant))* 0.2),
[GMV USD],
Blank()
)
)
 
Where
 
UniqueMexBrands = 
= CALCULATE( DISTINCTCOUNT(dmerchant[Chain_name]),FoodMetrics)
5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi @GraceTCL  

 

You could create a measure by the following formula: 

Step1: new table  

newtable = SUMMARIZE('dmerchant',[Chain_name],"_gmv",[GMV Total]) 

 Step2: new a measure 

total = SUM('newtable'[_gmv]) 

 Step3: modify the %GMVContribution  measure 

%GMVContribution = SUMX(SUMMARIZE('dmerchant',[Chain_name],"1",[Top20%MexBrandsByGMV]/[total]),[1]) 

 The final output is shown below:  

 v-yalanwu-msft_0-1620727402358.png

Best Regards,
Community Support Tea
m_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
  

AlB
Super User
Super User

@GraceTCL 

I don't understand the question. Plus I don't see what this has to do with the solution I provided in my previous post

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

 

AlB
Super User
Super User

Hi @GraceTCL 

Create a new measure based on the one you already have:

%GMVContribution TOT = 
SUMX( DISTINCT(dmerchant[Chain_name]), [%GMVContribution] )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Hi @AlB 

 

Thanks for your reply.

When I change "GMV Total" to this formula below, the Total % contribution of the MexBrands couldnt work anymore. Essentially, I want "GMV Total" to be still subjected to implicit context filters of vertical.

 

Capture4.PNG

Formula:

GMV Total = CALCULATE([GMV USD],ALLEXCEPT(Vertical,Vertical[Vertical]))

 

Updated sample file here:

https://www.dropbox.com/s/hkhx0yziyakgtbn/Sample.pbix?dl=0

Hi @v-yalanwu-msft 

 

Thanks for your reply. However, when I vary the time periods, the denominator is still the GMV number across the entire periods, hence distorting derived % contribution. Could you advise how and where can I vary the denominator GMV to change as well as per time period so that % contribution is correct?

 

See an unexpected output as per problem stated above where total GMV still remains at 402 which represents the full period but it should be smaller.

 

Capture.PNG

 

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.