cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to parameterize a DAX formula/measure

Hello,

I have two different Power BI dashboards that are identical except for one column in my database; one dashboard uses a column called v7 Twentile and the other dashboard uses a column called v6 Twentile.  These columns contain a number between [1 ... 20] and form the rows of a matrix visualization:

8.JPG

I've created five DAX formulas that look something like this:

sum_mailed_allrows_v7 = calculate([units_mailed], all('campaign_performance'[v7_twentile]))
where the context is defined to be the entire v7_twentile column of the table, campaign_performance.  The problem I'm trying to solve is that right now I have to create the exact same formulas for the v6 Twentile dashboard, so the formula, above, looks like this:
sum_mailed_allrows_v7 = calculate([units_mailed], all('campaign_performance'[v6_twentile]))
I would rather just have five DAX formulas rather than 10, but I don't know how to change the v7_twentile/v6_twentile into a parameter that can be set to be a different value on each dashboard. 
 
Other than that difference, the dashboards are identical.  I'm fairly new to Power BI and DAX so any specific instructions would be appreciated.
1 REPLY 1
Super User III
Super User III

Hi @Anonymous ,

 

Is the database the same for all 10 dashboards? and you need to make the calculation based on different columns?

 

I would unpivot those columns and then use a slicer or a filter within the measure to filter out the V7 or V6 value


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors