Forum Discussion
Quick measure functionality in report
- 1 year ago
Hi Poojara,
It works! Thanks for the solution.
Riksall you may be able to achieve this with parameter fields. I see from your post you already know how to implement these but i'll add details for others that may need this information.
Create a field parameter that includes all 10 of your measures:
Go to Modeling > New Parameter > Fields.
Add your 10 measures.
This creates a slicer-friendly table with a [Name] and [Fields] column.
You’ll need 2 copies of this parameter table (e.g., MeasureSelector1 and MeasureSelector2) to allow two independent selections from 2 separate slicers . SELECTEDVALUE() assumes only one measure is selected per slicer, so you will want to restrict slicers to single selection.
You will then need a DAX measure that compares the 2 slicer selections
Correlation =
VAR Measure1 = SELECTEDVALUE(MeasureSelector1[Fields])
VAR Measure2 = SELECTEDVALUE(MeasureSelector2[Fields])
VAR TableWithValues =
ADDCOLUMNS (
VALUES ( 'YourData'[YourGroupingColumn] ),
"X", CALCULATE ( Measure1 ),
"Y", CALCULATE ( Measure2 )
)
VAR CorrelationResult =
CORREL ( SELECTCOLUMNS ( TableWithValues, "X", [X], "Y", [Y] ), [X], [Y] )
RETURN
CorrelationResult
Replace 'YourData'[YourGroupingColumn] with the dimension over which you want to calculate correlation (e.g., Date, Customer, etc.)
Please let me know if this works by giving a thumbs up and marking as solved, thanks
- Riksall1 year agoFrequent Visitor
Thanks Wardy, but CORREL is not a PBI function. I just want to use the code which is generated by the quick measure, and choose my 2 measures as variables in that code..