False Tie in RankX - but only when I select Customer 5!

WilliamPHII

New Member
Joined
Aug 30, 2018
Messages
20
I tried adding a basic card to my Power BI file, and what should have taken 5 minutes has stretched to an hour and half. :mad:

I have one table. It has maybe 150 unique customers and 12,000 rows with all their invoices.

I made a simple RankX measure: RankX(All(Table[CustomerName]),[Total Sales]). Total sales is a basic "Sum(Table[Invoices]).

When I drop this RankX measure in a table on Power BI, it works like a charm. I add Total Sales, and I can see it is working perfectly.

The problem is when I slice the table for one customer, using the same customer column in the slicer! When I do that, and select for one customer, all is well for Customer ranked 1, 2, 3, and 4. But when I click on the slicer on the customer I know is ranked 5, the table shows it as 6. When I slice for the customer I know is 6, it ALSO shows six. The total sales measure in the same table still plainly shows them as having different total sales. When I move on to Customer 7, 8, and so on, the table shows the correct value. It seems something is seriously wrong with customer 5. And I have no idea what it could be.

I have no blanks in my customer column or invoice column.

In my real model I have the customers as a lookup table. But the same thing was happening using a lookup table, and once I realized it happened when I just used one table, I figured it be easiest to keep relationships out of it and focus on the case of just one table.

Very grateful for anyone that can help or even toss a crumb of an idea my way.

William
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Correction: I see it happens for other customers down the line as well. Weird ties that are absolutely false.

I'm just not good enough to understand how this could happen only when I slice for one customer. And it doesn't happen for every customer--just here and there as you go up down the ranking.
 
Upvote 0
Hi William,

I tried to recreate your issue but without much success - I get correct results for all my 10 exemplary clients. I have used the same measures as you did.

Have you tried adding [Total Sales] to your main table and to the "filtered" table and see if the value is also changing? Alternatively, is there any chance you could share your underlying data or the .pbix file itself?

1589829101597.png
 
Upvote 0
Well, the latest twist is I went to get a clean file for you with fake customers names and only two columns (Customer and Invoice) and I discovered when I import only those two columns from my Excel file, the bug doesn't happen!

Any thoughts on that?? I need the whole table for my report, but apparently something is throwing if off...
 
Upvote 0
SampleFile2.xlsx
ABCDEFGHIJKLMN
1CustomerInvoiceEstimated Labor HoursEstimated Labor CostEstimated Material CostEstimated Other CostsEstimated Total CostActual Labor HoursActual Labor CostActual Material CostActual Other CostsActual Total CostProfit AmountProfit %
280B10240330017823078.655505410.6529701832.493069.02065755.4255656.935654583.064350.4476
364L214.760000000163.840163.8450.920.2371
417Q39835.514661.487917.2117807.3872026444.59150879243.05416963.879931354.227561.1339312274.366070.3081
517Q39835.59007.734864.1811092.9272016677.1104626441.7049653.5102381.82516477.039223358.46080.5864
617Q014661.487917.2117807.3872026444.590000000
717Q0000000000000
823W56421812.77978.912802.0915039311582976.0942535.99582272.39935153784.4891721857.5108280.3292
923W2618817.22441.291253.661501844.95582359.0941085.344991001544.438991073.561010.4101
1023W69342080.791123.663405.071504678.7319081164.7113029.13513114.86042364308.7065542625.2934460.3786
1171S1628359.14193.93698.483801272.41329202.993589.19846132.2945768924.4860368703.51396320.4321
1236J1180253.7136.99415.71380932.7232143.144377.22838121.523675641.896055538.1039450.456
1316P60201832.37989.522740.313804109.8316361009.4122408.43597393.86466313811.7126332208.2873670.3668
1416P4850.0800000003095.53380.30276973475.832771374.247230.2833
1543Q59751658.04895.382301.955503747.331413871.8212455.35461504.51532393831.6909342143.3090660.3587
1635I82882423.211308.563102.777205131.3321501326.552859.93059844.2255030.705593257.294410.393
1744R69741813.41979.32680.923804040.2222721401.8242361.35983361.86522844125.0490582848.9509420.4085
1844R0000000000000
1923W2037613.14331.09878.431501359.52653402.901781.322111001284.22311752.776890.3696
2015O176174519.982440.846882.33144010763.1745822827.0946812.907271394.46511034.466276582.533730.3736
2145S2754615.8332.531192.315502074.84368227.056976.21095173.4413751376.7083251377.2916750.5001
2256D66498.4253.15176.2275504.357043.19151.81079100295.00079368.999210.5557
23150T15000000000001501
2417Q30000000000003001
2561I1023.8800000000001023.881
2626Z668.640000000503.80503.8164.840.2465
277G1274267.32144.35442.06380966.41210129.57365.55509158.6727045653.7977945620.20220550.4868
2843Q2775566.8306.071205.985502062.05674415.8581098.72461234.31464831748.8972581026.1027420.3698
2979A98981611.15870.025043.687206633.720271231.3844333.5876876.356441.32163456.67840.3492
3064L100.2000000074.69074.6925.510.2546
31125U10000000000001001
327G3851845.32456.471444.676322533.14820505.941335.50337845.0252686.468371164.531630.3024
3316P56000000041.64041.6414.360.2564
34149S2635.200000001943.21165.95959022109.16959526.03040980.1996
35159C0000000000000
362B1432300.91162.49562.763801105.25271167.207509.66998111.3036652788.1806452643.81935480.4496
3716P1140233.38126.02452.99380959.01215132.655407.81514113.3463733653.8165133486.18348670.4265
3845S19323.6712.7952.56150215.357244.42445.57297100189.996973.003030.0156
3964L38101054.02569.161953.283802902.44730450.411695.34121183.94922532329.7004351480.2995650.3885
4018R346.080000000250.93100350.93-4.85-0.014
4145S1569238.21128.63630.662751034.29248153.016569.53969133.9017794856.4574694712.54253060.4541
4221U600111.0359.96173.16190423.1214086.38150.21282100336.59282263.407180.439
43109E1159233.46126.07470.4190786.47207127.719408.06495100635.78395523.216050.4514
4497S77192246.991213.393011.225504774.6119181183.4062715.36919291.96846414190.7436543528.2563460.4571
4512L4153924.02498.961495.97202714.861057632.9691355.49565751.18693332739.6515831413.3484170.3403
4654B1356187.05101.01302.097201123.116199.337270.24883216.8962652586.4820952769.51790480.5675
4754B1376293.61158.52367.63360886.15344212.248343.55916220.0953252775.9024852600.09751480.4361
481A73695.2751.44209275535.44184113.528183.00287100396.53087339.469130.4612
491A1600293.1158.27576.652751009.92191117.847509.57611199.2749821826.6980921773.30190790.4833
5032F4181712.55384.782140.843802905.62972599.7241793.05955263.31096182656.0945121524.9054880.3647
5132F2168425.62229.841168.323801778.16534329.4781007.16144136.53627491473.175715694.82428510.3205
528H2118521.93281.84867.415501699.25742457.814764.116581001321.93058796.069420.3759
5371S15000000000001501
5430D476.680000000355.060355.06121.620.2551
5526Z1696368.93199.22532.683801111.9355219.035646.33463104.9157704970.2854004725.71459960.4279
5616P70021739.03939.092794.313804113.418551144.5352878.83902264.8481914288.2222112713.7777890.3876
5716P461.560000000338.09100438.0923.470.0508
5823W2697804.97434.681199.521501784.2856528.1521044.867621001673.019621023.980380.3797
5923W47381510.97815.922295.81503261.721519937.2232067.19051003104.41351633.58650.3448
6016P43441279.33690.881915.983802986.861022630.5741685.86479272.99735092589.4361411754.5638590.4039
6116P301500000002054.861002154.86860.140.2853
62109E17920.8411.2543.86100155.113420.97837.43363100158.4116320.588370.115
638H1894312.96169752.72751196.7245151.165656.743235.891761043.79976850.200240.4489
6420T43901218.14657.792090.871502898.661071646.2571850.61981002596.87681793.12320.4085
6520T41041210.92653.922008.721502812.64940579.981742.544161002422.524161681.475840.4097
6620T3275912.39492.681530.621502173.3856528.1521353.85653143.9918772026.0004071248.9995930.3814
6720T46671468.23792.852208.831503151.681459900.2032007.026371003007.229371659.770630.3556
6820T491154.4283.39236.92150470.3115595.635206.87465100402.5096588.490350.1802
69111G3905938.26506.671603.717202830.38888547.8961397.31602527.55815042472.770171432.229830.3668
7027A421.80000000348.020348.0273.780.1749
7115O7114.52131.631151.112881.927204753.031481913.7772617.37522766.41087624297.5630962816.9369040.3959
7212L1339263.27142.17367.487201229.65301185.717381.00118491.51058.21818280.781820.2097
7369Q23964.7334.96140.460175.42170104.89126.984410231.874417.125590.0298
74105A859161.4187.17249.89275612.06176107.017222.98526100430.00226428.997740.4994
75107C45000000000004501
7617Q02251.891216.022667.337204603.3518341131.5782332.44872175.41549133639.442211-3639.4422110
77149S1081230.95124.72359.39190674.11254156.718313.34315100570.06115510.938850.4727
7862J165.20000000118.98100218.98-53.78-0.3255
797G3868822.18443.961629.545502623.5680414.011481.14519120.84219072015.9973811852.0026190.4788
8020T1212.960000000784.04100884.04328.920.2712
8130D203.840000000144.860144.8658.980.2893
8264L67791978.41068.333250.63804698.931407868.1192789.72296298.05219373955.8941542823.1058460.4164
8332F15000000000001501
8477Y2899.200000002016.5202016.52882.680.3045
8518R4876.481301.95703.052401.243803484.291100678.72062.90176214.40412472956.0058851920.4741150.3938
8693O2894559.33302.041324.335502176.37517318.9891184.7935781.08955252284.872052609.12794750.2105
8795Q1064332.15179.36400.16190769.52431265.927354.95381100720.88081343.119190.3225
8830D187200000001489.3301489.33382.670.2044
8918R491.9687.7447.38125.77190363.159256.764109.76479100266.52879225.431210.4582
9095Q1421292.07157.72575.683801113.4332204.844475.07124100779.91524641.084760.4512
9123W3407942.66118.7150311.3614186.997114.50975100301.5067538.493250.1132
9220T37831080.35583.391835.071502568.461012624.4041627.46874109.99776872361.8705091421.1294910.3757
9377Y163.080000000113.430113.4349.650.3045
9423W529.58210.02113.41198.46150461.8711470.338194.71575100365.05375164.526250.3107
9570R14525.7513.936.72150200.623119.12733.079100152.206-7.206-0.0497
9679A1679160.3286.57304.487201111.0513784.529267.01706145.2864785496.83253851182.1674620.7041
9720T1246408.33220.5512.7150883.2403248.651460.03337100808.68437437.315630.351
9820T2872890.01480.611372.341502002.95655404.1351189.369881001693.504881178.495120.4103
99143M0319.68172.63869.23801421.83278171.526840.8377701012.36377-1012.363770
100111G43851305.27704.841674.457203099.29971590.2571488.764211012.4753091.496211293.503790.295
101105A816131.4871300.52150521.529659.232256.97525100416.20725399.792750.4899
102149S46971.6538.7156.54190385.2411872.806151.18052100323.98652145.013480.3092
10316P55275.540.77165.84190396.6110564.785146.86475100311.64975240.350250.4354
1048H2095444.78240.19768.55501558.69371228.907657.20627285.609171171.72244923.277560.4407
10520T31371025.53553.781375.121502078.9880542.961271.55576151.45635691965.9721171171.0278830.3733
10679A1003140.4475.84209.59360645.4311671.572184.46566100356.03766646.962340.645
10762J277.020000000201.65100301.65-24.63-0.0889
10892N1566268.13144.79468.41360973.2342211.014426.71287283.255174920.982044645.0179560.4119
10930D80000000059.49059.4920.510.2564
11045S1026171.4392.57376.085501018.65225138.825257.35114139.8735124536.0496524489.95034760.4775
11118R1487.64317.63171.51617.313801168.82193119.081538.46963120.888639778.439269709.2007310.4767
11261I1155.9600000000001155.961
11337K68693.9250.72175.2275500.929961.083154.19811100315.28111370.718890.5404
11479A49871.6638.69127.48150316.179759.849118.14847100277.99747220.002530.4418
11517Q0000000000000
11630D200.40000000149.370149.3751.030.2546
11792N920141.9976.68244.87360681.5512375.891219.93086166.4078928462.2297528457.77024720.4976
11816P442200000002823.48274.19739463097.6773951324.3226050.2995
11917Q0000000000000
12017Q0000000000000
12164L10540000000811.670811.67242.330.2299
12245S1146193.4104.44395.76275775.2232143.144347.14339156.2329875646.5203775499.47962250.4358
123109E1703381.02205.75767.553801353.3359221.503673.86197105.34879541000.713765702.28623460.4124
12416P642104.9156.65208.24190454.8911973.423186.42903100359.85203282.147970.4395
12531E2376586.5316.73969.262851570.99457281.969846.54147149.3189931277.8294631098.1705370.4622
12650X567.840000000403.530403.53164.310.2894
12770R0000000000000
12817Q2306736397.43878.563801655.99975601.575822.08956187.39022981611.05479694.94521020.3014
12961I1013.4800000000001013.481
1302B31152.3828.2887.84150266.126037.0275.43994100212.4599498.540060.3168
13123W198.50000000134.22100234.22-35.72-0.1799
13223W470.40000000318.83100418.8351.570.1096
13316P61490.8649.07195.36190434.439759.849172.11759100331.96659282.033410.4593
13418R16276.7741.45106.68150298.13261161.037105.110890266.14789-104.14789-0.6429
13516P1760000000130.880130.8845.120.2564
13616P220.440000000164.310164.3156.130.2546
13723W6824.7213.3419.56150182.94225.91424.88974100150.80374-82.80374-1.2177
13823W043.8123.6649.96150223.625131.46755.40523100186.87223-186.872230
13950X1397.760000000993.30993.3404.460.2894
14023W15000000000001501
14132F0000000000000
Sheet1
 
Upvote 0
That's only the first few rows, and the problem doesn't show up if you use only those...

Can I attach the PowerBI file somehow??

Thanks!

William
 
Upvote 0
Well, I guess I solved it. I'm not sure which thing did the trick, but I removed some unnecessary columns, as well as rounded most of the columns to two decimal places.

Thanks for looking at it!

William
 
Upvote 0
Hi William,

Oh wow! What a turn of events while I was asleep :)
I found myself in a similar situation on a few occasions - once I started preparing the source file and try to explain how to recreate the issue, I realized that I cannot really recreate it, or I simply found the issue myself while reviewing it.

Anyway, I'm very glad you figured it out! Take care.
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top