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
Index_Match
Frequent Visitor

Passing Parameter Results to New Measure Calculation

Hi all, 

I'm working on building a staffing calculator. Essentially the dashboard user is able to update inputs on the fly using PowerBI parameters which then feed into into a bullet chart that shows current headcount vs. what the calculator says we need (see below). However, the tricky part is that some roles need to be calculated based off the results returned for the subordinate roles. I've posted a screenshot below as an example. I'm having trouble creating a measure that combines the results for the associate roles and also calculates the manager headcount based off the projected heacount of the corresponding associate role. 

 

Let me know if you need any more details and I appreciate the help!

 

Index_Match_1-1620848580691.png

Index_Match_2-1620848611144.png

*Graph is just example of desired outcome, not currently working in Power BI

 

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Index_Match ,

 

Please use switch function to create measure like below:

Measure = SWITCH(TRUE(),
                MAX('Table'[Column1])="aa",Parameter[Parameter Value],
                MAX('Table'[Column1])="am",Parameter[Parameter Value]/10,
                MAX('Table'[Column1])="fa",'Parameter 2'[Parameter Value 2],
                MAX('Table'[Column1])="fm",'Parameter 2'[Parameter Value 2]/5)

V-lianl-msft_0-1621218468528.png

 

 

Best Regards,
Liang
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

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Index_Match ,

 

Please use switch function to create measure like below:

Measure = SWITCH(TRUE(),
                MAX('Table'[Column1])="aa",Parameter[Parameter Value],
                MAX('Table'[Column1])="am",Parameter[Parameter Value]/10,
                MAX('Table'[Column1])="fa",'Parameter 2'[Parameter Value 2],
                MAX('Table'[Column1])="fm",'Parameter 2'[Parameter Value 2]/5)

V-lianl-msft_0-1621218468528.png

 

 

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

 

This was one component of the overall solution. I also had to use the VAR function to find the total headcount for just "aa" and then use that measure in place of the parameters you have shown. 

Headcount for AA =
VAR
AA= FILTER(ALL(Table1,Table1[Role]="AA")
RETURN
CALCULATE([Headcount],AA)

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.