How to find physical quantities with the most dimensions

I am wondering how to find physical quantities with multiple dimensions.
The farad is the most complicated unit I know and has dimensions of mass, length, time, and electric current.
I have found an example in the documentation for PhysicalQuantity that plots the physical quantities with the greatest sum of the powers of the dimensions PhysicalQuantity—Wolfram Documentation
and there are some interesting physical quantities including the “WiedemannFranzLawRatio” which has five dimensions but I am wondering if there is a way to do something similar but with the total number of dimensions instead of the sum of the powers of the dimensions.

I am interested in dimensional analysis and am working on a resource function and finding a physical quantity that has five, six, or even seven dimensions would make testing my dimensional analysis function easier.

Peter,

here is one simple way (counting is done in terms of SI-units):

constants = 
  EntityClass["PhysicalConstant", All][{EntityProperty["PhysicalConstant", "Name"], EntityProperty["PhysicalConstant", "Value"]}];
Grid[ReverseSortBy[
  With[{un = QuantityUnit@UnitConvert[#2]}, {#1, N@#2, un, 
      Length[Cases[un, _String, All] /. "DimensionlessUnit" -> Nothing]}] & @@@ constants, Last], Frame -> All]

How would I do it with Physical Quantities?
I tried this, but it didn’t work.

constants = 
  EntityClass["PhysicalQuantity", 
    All][{EntityProperty["PhysicalQuantity", "Name"], 
    EntityProperty["PhysicalQuantity", "Value"]}];
Grid[ReverseSortBy[
  With[{un = QuantityUnit@UnitConvert[#2]}, {#1, #2, un, 
      Length[Cases[un, _String, All] /. 
        "DimensionlessUnit" -> Nothing]}] & @@@ constants, Last], 
 Frame -> All]
[@Henrik Schachner](https://community.wolfram.com/web/henrikschachner) 

When I CopyAndPaste and run my code I just posted it works! Maybe try again with a fresh kernel. Or are you using an older version of Mathematica?

The output works but is not correct.

Physical Quantity Highest Dimension.nb (1.54 MB)

I have no idea what the problem with this specific piece of code could be (some invisible letter?). Anyway - please find attached my notebook with the respective code.

Physical Quantity Highest Dimension_1.nb (102 KB)

The code worked for physical constants I want to adapt the code for physical quantities, another entity type.

Ah, I see! Maybe so then:

units = DeleteMissing@
   DeleteDuplicates@
    EntityClass["PhysicalQuantity", All][
     EntityProperty["PhysicalQuantity", "NamedSIUnit"]];

Grid[ReverseSortBy[
  With[{un = QuantityUnit@UnitConvert[#]}, {#, N@#, un, 
      Length[Cases[un, _String, All]]}] & /@ units, Last], 
 Frame -> All]

@Henrik Schachner
Is there a way to only query physical quantities with named SI units (the seven base units plus the 22 SI units with special names such as gauss and ohm) using something similar to “NamedSIUnit”?