Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Riksall
Regular Visitor

Quick measure functionality in report

When adding a quick measure you can choose your parameters. For instance for the correlation coefficient you can supply your 2 measures. I want that same functionality in my report, because i have 10 measures and for each possible combination i want the correlation to be calculated. So i don't want 10! separate quick measures, but a input box in my report for measure 1 and for measure 2. I looked at a combination of calculation groups and parameter fields. But i can't seem to put 2 different SELECTEDMEASURE() in one calculation item.
So is there a general approach for this? Thanks!

4 REPLIES 4
v-mdharahman
Community Support
Community Support

Hi @Riksall,

Thanks for reaching out to the Microsoft fabric community forum.

It looks like you want to dynamically calculate the correlation coefficient between two selectable measures out of a total of 10 available measures but in Power BI, when using Quick Measures, you can supply two measures as input for correlation, but that method creates a fixed measure each time which you does not wants as it creates separate quick measures for every possible pair of the 10 measures.
While you're right that calculation groups don’t support multiple SELECTEDMEASURE() calls in a single item, there's a solid workaround suggested by @wardy912 of using field parameters that gives you the flexibility you're looking for. Kindly go through the response given by @wardy912 and check if your issue can be resolved.

 

I would also take a moment to thank @wardy912 and @lbendlin, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

wardy912
Resolver II
Resolver II

@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

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.. 

lbendlin
Super User
Super User

That is not currently supported. If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.