Forum Discussion
Need help badly - Percentile and Visualization
Hello Guys,
I need some help and I got stuck on this for awhile already.
So I have this Table
| Date | Product | X |
| 1/2/1990 | A | 0.017791 |
| 1/3/1990 | A | -0.00256 |
| 1/4/1990 | A | -0.00818 |
| 1/5/1990 | A | -0.00974 |
| 1/8/1990 | A | 0.0046 |
| 1/9/1990 | A | -0.01179 |
| 1/10/1990 | A | -0.00658 |
| 1/11/1990 | A | 0.003511 |
| 1/12/1990 | A | -0.02452 |
| 1/13/1990 | A | 0.022791 |
| 1/14/1990 | A | 0.002436 |
| 1/2/1990 | B | -0.00318 |
| 1/3/1990 | B | -0.00474 |
| 1/4/1990 | B | 0.0096 |
| 1/5/1990 | B | -0.00679 |
| 1/8/1990 | B | -0.00158 |
| 1/9/1990 | B | 0.003635 |
| 1/10/1990 | B | 0.008846 |
| 1/11/1990 | B | 0.014057 |
| 1/12/1990 | B | 0.019269 |
| 1/13/1990 | B | 0.02448 |
| 1/14/1990 | B | 0.029691 |
| 1/2/1990 | C | 0.008511 |
| 1/3/1990 | C | -0.01952 |
| 1/4/1990 | C | 0.029791 |
| 1/5/1990 | C | 0.009436 |
| 1/8/1990 | C | 0.003822 |
| 1/9/1990 | C | 0.002262 |
| 1/10/1990 | C | 0.0166 |
| 1/11/1990 | C | 0.000212 |
| 1/12/1990 | C | 0.005423 |
| 1/13/1990 | C | 0.015511 |
| 1/14/1990 | C | -0.01252 |
I want to calculate percentile but I need to show by % the difference between TWO product at a time.
Showing percentile for the two products chosen is the one i got stuck plus how to calculate without giving errors
Lets say i pick Product A and C and chooses date range from 1/2 to 1/12
This should be the finish result.
Formula :
1st Product = PERCENTILE.EXC(1st Product X, PERCENTAGE)
2nd Product = PERCENTILE.EXC(2nd Product X, PERCENTAGE)
Result = 1st Product - 2nd product
*see the one i circle below
PBIX File : PBIX File Link
Here is one way to do it. Make two tables with these expressions with no relationship to the others.
PctValues1 = GENERATESERIES(0.1,0.9,0.1)PctValues2 = GENERATESERIES(0.1,0.9,0.1)Put one column on rows and the other one on columns in a matrix, along with this measure.NewMeasure = var firstproduct = MIN(ProductsX[Product])var lastproduct = MAX(ProductsX[Product])var pct1 = Min(PctValues1[Value])var pct2 = Min(PctValues2[Value])var prod1pct = CALCULATE(PERCENTILEx.EXC(ProductsX, ProductsX[X], pct1), ProductsX[Product]=firstproduct)var prod2pct = CALCULATE(PERCENTILEx.EXC(ProductsX, ProductsX[X], pct2), ProductsX[Product]=lastproduct)var result = prod1pct-prod2pctreturn resultRegards,PatAnonymous Solution provided by mahoneypat will work great and similar approach is used in the attached pbix.
3 Replies
- mahoneypat
Microsoft Employee
Here is one way to do it. Make two tables with these expressions with no relationship to the others.
PctValues1 = GENERATESERIES(0.1,0.9,0.1)PctValues2 = GENERATESERIES(0.1,0.9,0.1)Put one column on rows and the other one on columns in a matrix, along with this measure.NewMeasure = var firstproduct = MIN(ProductsX[Product])var lastproduct = MAX(ProductsX[Product])var pct1 = Min(PctValues1[Value])var pct2 = Min(PctValues2[Value])var prod1pct = CALCULATE(PERCENTILEx.EXC(ProductsX, ProductsX[X], pct1), ProductsX[Product]=firstproduct)var prod2pct = CALCULATE(PERCENTILEx.EXC(ProductsX, ProductsX[X], pct2), ProductsX[Product]=lastproduct)var result = prod1pct-prod2pctreturn resultRegards,Pat- AnonymousNot applicable
Wow i didnt know i dont need relationship on this.
This is really helpful and the same time learn something from this!thank you
parry2k mahoneypat
- parry2k
Super User
Anonymous Solution provided by mahoneypat will work great and similar approach is used in the attached pbix.