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
rob_vander
Helper I
Helper I

call two different measure parameter in DAX

Hi All,

 

I have created two measure parameter, Parameter1 contains 3 measure as M1,M2 & M3. Parameter2 contains 2 measures M4,M5. If I directly call this parameter in table visual, it works fine and displayes individual measures of that parameter, but what I want is, if select Group1 from slicer, I want to show Measures of Parameter1 in table visual, basically want to call Parameter1 table. If I select Group2 from slicer, I want to show measures of Parameter2.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rob_vander ,

 

I suggest you to create one parameter with all measure names and then add a Group column.

Group = 
IF(Parameter[Parameter] in {"M1","M2","M3"},"Group1","Group2")

vrzhoumsft_0-1697092202810.png

Result is as below.

vrzhoumsft_1-1697092228092.png

vrzhoumsft_11-1697092416961.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
rob_vander
Helper I
Helper I

@DallasBaba  may be I have not explained it correctly. Basically I have created Field parameter on front end. Parameter1 contains 3 measures M1 (sum(M1)), M2 and M3 respectively. when I select Group1, I want to show values of M1, M2 & M3 in the report. So report would look like below

Dimension1M1M2M3
A102030

 

Similarly, if I select Group2, In same table visual, I would like to see values of  measures M4 & M5.

Anonymous
Not applicable

Hi @rob_vander ,

 

I suggest you to create one parameter with all measure names and then add a Group column.

Group = 
IF(Parameter[Parameter] in {"M1","M2","M3"},"Group1","Group2")

vrzhoumsft_0-1697092202810.png

Result is as below.

vrzhoumsft_1-1697092228092.png

vrzhoumsft_11-1697092416961.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@rob_vander you can accomplish this by creating a measure that switches between Parameter1 and Parameter2 based on the slicer selection.

 

Create a measure that selects the appropriate set of measures based on the slicer value: 
Dynamic Measures =
VAR SelectedGroup = SELECTEDVALUE('Table'[Group])
RETURN
SWITCH(
SelectedGroup,
"Group1", [Parameter1.M1] + [Parameter1.M2] + [Parameter1.M3],
"Group2", [Parameter2.M4] + [Parameter2.M5],
BLANK()
)


Then create a table visual in your report with "Dimension1" as a dimension and use the "Dynamic Measures" measure as values.
When you select "Group1" in the slicer, it will display the sum of M1, M2, and M3.
When you select "Group2," it will show the sum of M4 and M5.

 

The table visual should look like this:

dallasbabatunde_0-1697046616463.png

 

let me know if this works

Thanks

Thanks
Dallas
DallasBaba
Super User
Super User

Hi @rob_vander 

You can dynamically use field parameters to change the measures or dimensions.

To get started, you need to enable the Field parameters preview feature. 

Go to File > Options and Settings> Options > Preview features in Power BI Desktop. Select the Field parameters.

 

Once enabled, you can create a new  

Measure = 

IF (    

SELECTEDVALUE ( 'Table'[Group] ) = "Group1",

    [Parameter1.M1] + [Parameter1.M2] + [Parameter1.M3],

    [Parameter2.M4] + [Parameter2.M5] 

)

 

See relevant solution:

https://community.fabric.microsoft.com/t5/Desktop/using-parameter-values-in-visual-filter/m-p/294517

 

You can also learn more about field parameters

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

I hope this help

Thanks

Babatunde Dallas

Thanks
Dallas

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.