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
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
MFelix
Super User
Super User

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