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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Asjen
Frequent Visitor

Using a (data) parameter in measures, to change behaviour of buttons

Hi all,

 

After trying in all sorts of ways and looking at a lot of other forum posts, I still could not get it to work, so here's my question!

 

We deliver reports to a number of customers, some of which have a Basic subscription and some of which have a Plus subscription. How I would like it to work:

  • We have defined a parameter "CustomerName" in which we select which customer the report is for
  • We have defined a table "Subscriptions" in which we identify for each customer whether he has the Basic of Plus subscription

My goal is to create a measure which looks at the parameter value for CustomerName I have set, and then finds the subscription name in the Subscriptions-table. Using that measure, I can then build different other measures that can e.g. determine what text to display or to which destinations buttons should go.

 

However, I can't get it to work: I cannot 'extract' the parameter value in a measure. How should this be done?

 

Hereby you find a couple of screenshots to clarify.

 

I hope you can help, thanks in advance!

 

Regards,

Asjen

 

2021-04-15 16_45_13-Manage Parameters.png2021-04-15 16_49_00-Untitled - Power Query Editor.png2021-04-15 16_49_58-Untitled - Power BI Desktop.png

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Asjen ,

 

I think you may need to pull your parameter values into their own queries to be able to reference their values in measures.

 

Try creating a blank query in Power Query and coding it like this:

 

let
  Source = #table({"paramCustomer"}, {{#"CustomerName"}})
in
  Source

 

This should give you a single-value table to reference in calculations.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @Asjen ,

 

I think you may need to pull your parameter values into their own queries to be able to reference their values in measures.

 

Try creating a blank query in Power Query and coding it like this:

 

let
  Source = #table({"paramCustomer"}, {{#"CustomerName"}})
in
  Source

 

This should give you a single-value table to reference in calculations.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Asjen
Frequent Visitor

Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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