Presenting 'any' type date within a Pivottable data area

pjmorris

Well-known Member
Joined
Aug 2, 2012
Messages
2,172
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have data in a column of document numbers with the form: 'C11-123-xxx-123'. It is of type 'Any' in Powerquery. Yesterday I created a Pivottable with appropriate rows and columns to identify the data (it actually only returns a single entry at each data point). The measure MIN(qrySrc[Doc No]) worked perfectly (honest - I was surprised). Today it returns an error. Perhaps, when I created the table I didn't try to refresh it and that until I did so it was quite happy as I have a correctly populated table to show that it worked.

Does anyone have any idea why it may have worked and now doesn't. Or, does anyone know how I can get the Document Number returned to the data area of the form.

many thanks.

Peter
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Assuming you are using the data model and Power Pivot, you can use a CONCATENATEX measure to return text in the values area. I can't see how MIN would ever have worked.
 
Upvote 0
Solution
Hi Rory, I didn't expect MIN to work, but was just searching for something that might - I hadn't come across CONCATENATEX which will be useful. However, I've checked again and following a reboot the MIN function is working as before (it also works with MAX) - so I guess that it is simply picking the first (or last) from the list. The error, I suspect, was that my Excel installation appears to 'fall back' to a previous version from the 2016 when something goes wrong. Its a corporate solution and I believe I've got elements of 2013 still on the machine - it occasionally does weird things! (sounds like flannel, but thats the truth!).

Many thanks for the reply and delighted to find the right way of doing this.

Regards

Peter
 
Upvote 0
following a reboot the MIN function is working as before (it also works with MAX) - so I guess that it is simply picking the first (or last) from the list
That's weird but I shall have to try that - useful if it does work!
 
Upvote 0
Hi Rory, I tried this measure:

=CONCATENATEX(qryVault[Babcock Doc No],", ")

but I received an error that a single value for the table couldn't be determined, which is odd because a single value would be pointless in this context. Have I missed something?

Edit: Corrected it: =CONCATENATEX(qryVault, [Babcock Doc No],", ") I had the syntax wrong!
 
Upvote 0
Hi Rory,

It remains weird. MIN really did work as I've just spent an hour demonstrating it to my boss etc. However, now, it doesn't work and rebooting didn't cure it - that said, I've made a few amendments but don't think they should have any affect. I've tried the CONCATENATEX approach, which worked, but when I try to clear a slicer after filtering it refuses to do so - its as if the Concatenation is trying to return too many values and the system simply gives up. Additionally, if I remove the measure from the table I can remove the Slicer filter, but then I can't add the measure back; apply a filter and I can add the measure, but again cant remove the filter. The measure correctly worked across the entire data set when I amended the existing measure to replace MIN with CONCATENATEX. It really feels like a bit of a bug and I'm at a loss to know what to do.

Any thoughts gratefully received.

Regards
 
Upvote 0
What is the current measure, and what do you want returned if the filters are all removed? (I'm guessing you don't really want all the document numbers displayed?)
 
Upvote 0
HI Rory, I've been working on the measure this morning and it also occurred to me that the problem was trying to concatenate too many records. The measure now looks like this:

IF(COUNTA(qryVault[Doc No])<=16,CONCATENATEX(qryVault,qryVault[Doc No] & "","
"),"Too Many Records" )

The linefeed before the "),"Too Many Records") is deliberate as UNICODE(10) didn't seem to introduce a linefeed as necessary.

Regards
 
Upvote 0
FWIW, your CONCATENATEX functions should really be:

CONCATENATEX(qryVault,qryVault[Doc No],",")

with the third argument being the delimiter.

I take it that is now working OK?
 
Upvote 0
Hi Rory, yes it seems to be working fine. I think you miss read my measure though: the & "", section simply appends nothing to the qryVault[Doc No] - I know it seems pointless, but when things aren't behaving I'll try anything. The next " mark and the one on the line below actually bound the delimiter which is a newline. I know that too looks odd, but it does work to introduce a linefeed whereas the UNICODE(10) didn't do anything.

Many thanks for your help.

Regards
 
Upvote 0

Forum statistics

Threads
1,223,697
Messages
6,173,895
Members
452,536
Latest member
Chiz511

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