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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
lukmtb08
Helper III
Helper III

Reference to a Field Parameter: Calculate(Selectedvalue(Parameter'[Parameter]), ...)

Dear community,
I have created a field parameter, which contains period measures, e.g. "MTD", "YTD", "RunRate",...). 

All Periods Parameter = {
    ("25 ACT MTD P01 Ø", NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P01 Ø]), 0, "25 MTD"),
    ("25 ACT MTD P02 Ø", NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P02 Ø]), 1, "25 MTD"),
    ("25 ACT MTD P03", NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P03]), 2, "25 MTD"),



I would like to create a measure, which references to my parameter.
This measure should calculate the periods for a certain KPI.

Calculate(Selectedvalue(Parameter'[Parameter]), KPI="Revenue") does not work, as it returns 
Measures for Parameter_all Periods'[25 ACT MTD P01 Ø] instead of the value. 


Thank you very much for any support

2 ACCEPTED SOLUTIONS
Alex_Sawdo
Resolver II
Resolver II

I use a similiar solution to @bhanu_gautam , with a few differences that allows a little more customization:

Selected Measure = 
SWITCH(
    SELECTEDVALUE(
        'All Periods Parameter'[All Periods Parameter Fields]
    ),
    NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P01 Ø]),
    'Measures for Parameter_all Periods'[25 ACT MTD P01 Ø],
    NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P02 Ø]),
    'Measures for Parameter_all Periods'[25 ACT MTD P02 Ø],
    NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P03]),
    'Measures for Parameter_all Periods'[25 ACT MTD P03]
)

You can also wrap the returned measure in a FORMAT() function to control the format directly of the returned value, and you can add additional measures if needed. 

View solution in original post

v-prasare
Community Support
Community Support

@lukmtb08, As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?

 

@Alex_Sawdo & @bhanu_gautam Thanks for your prompt response

 

 

Thanks,

Prashanth Are

MS Fabric community support

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

View solution in original post

3 REPLIES 3
v-prasare
Community Support
Community Support

@lukmtb08, As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?

 

@Alex_Sawdo & @bhanu_gautam Thanks for your prompt response

 

 

Thanks,

Prashanth Are

MS Fabric community support

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query

Alex_Sawdo
Resolver II
Resolver II

I use a similiar solution to @bhanu_gautam , with a few differences that allows a little more customization:

Selected Measure = 
SWITCH(
    SELECTEDVALUE(
        'All Periods Parameter'[All Periods Parameter Fields]
    ),
    NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P01 Ø]),
    'Measures for Parameter_all Periods'[25 ACT MTD P01 Ø],
    NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P02 Ø]),
    'Measures for Parameter_all Periods'[25 ACT MTD P02 Ø],
    NAMEOF('Measures for Parameter_all Periods'[25 ACT MTD P03]),
    'Measures for Parameter_all Periods'[25 ACT MTD P03]
)

You can also wrap the returned measure in a FORMAT() function to control the format directly of the returned value, and you can add additional measures if needed. 

bhanu_gautam
Super User
Super User

@lukmtb08 

First, ensure that your field parameter is correctly set up and that it is being used in your report.

Create a measure that uses the SELECTEDVALUE function to get the selected period from your parameter.

Use the SWITCH function to handle different periods and calculate the KPI accordingly.

DAX
KPI Calculation =
VAR SelectedPeriod = SELECTEDVALUE('Parameter'[Parameter])
RETURN
SWITCH(
TRUE(),
SelectedPeriod = "25 ACT MTD P01 Ø", CALCULATE([Revenue], 'Measures for Parameter_all Periods'[25 ACT MTD P01 Ø]),
SelectedPeriod = "25 ACT MTD P02 Ø", CALCULATE([Revenue], 'Measures for Parameter_all Periods'[25 ACT MTD P02 Ø]),
SelectedPeriod = "25 ACT MTD P03", CALCULATE([Revenue], 'Measures for Parameter_all Periods'[25 ACT MTD P03]),
-- Add more conditions as needed
BLANK()
)

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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.