Forum Discussion
storing and using measure names from a table
Hi ThomasDay, thanks for reaching out to me. If I've understood the question right, what you are trying to do is quite complex, so I can't think of a clean cut solution for solving this.
Here's how I've understood this so far:
For simplicity, lets say you have 1 report page with 3 card vizualizations (25th percentile, 50th percentile, 75th percentile).
You want to use a slicer with 100 + measure names, so that when you select a measure from the slicer, the three cards will reflect each percentile calculated with that measure. Eg. selecting FTEsAcuteCare from the slicer would result in the cards displaying each percentile for FTEsAcuteCare.
Let us know if this interpretation of the problem is close enough and maybe someone else might have a light bulb moment and step in :)
If this is accurate, then for one the measure should result in a vector of values, not a value, because you have to have a vector of values to be able to calculate a percentile. I assume that your measures are set up like this, so one solution would be to use the SWICH statement (as in the parameter table link above) where you check which value has been filtered from the measure table and catch the selected measure with a SWITH statement like:
25thPERCENTILE = IF ( HASONEVALUE ( Measures[MeasureName] ), PERCENTILEX.INC(ALLSELECTED([ProviderNo]), SWITCH ( VALUES ( Measures[MeasureName] ), "FTEsAcuteCare", [FTEsAcuteCare], "2ndMeasure", [2ndMeasure], ... ) , 0.25) ...
This is not dynamic as the measures have to be hardcoded into the dax-statement, but with good documentation and a mainenance plan for updating the dax-statements, this might be a simple enough approach.
Of course there could be a more dynamic solution to this, but let me know if this brings you any closer to a solution that would suit the requirements.
- ThomasDay10 years ago
Impactful Individual
Hello all--and thanks for helping.
- We know that we cannot programmatically change a DAX measure based on a string value in an expression.
- On the other hand, 20mm rows, computing 600 measures for 5000+ entities and building synthesis ranking in this model--even if I could programmatically change a DAX measure in an expression--is a really good ETL stage for a large data set.
- These data update quarterly...so that allows a little latitude thinking about stages without building in much maintenance/worry/time.
- A new stage can take care of this issue:
- Export ( a little clunky) from a visualization of all entities and 600 measures (not sure when memory pops--so it may take several sets of the measures). With luck it's not too many sets...let's say I get lucky here.
Use SQL to transform into a long thin file like this...there are commands to do this part.
And voila! That becomes the input for the next stage. It's a big file 5000entities*600measures*no of years but now each calc is available!
I can then add the next layer of value add--compute the various percentile values for relevant cohort groups of providers (just use/share the base ETL provider file for that), build a parameter table for slicers with the measures appearing in the slicers--with a group slicer, then a measure slicer.
OK, it's early in figuring out the next steps, but this seems quite productive as an approach.
Thanks again---let me know what you think,
Tom
PS: if anyone knows how I can use the "work in excel" feature instead of the visualization export I am envisioning...I'm all ears!