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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
dkalina97
Helper I
Helper I

Slice with IF, Slicer with Values to select, Resulting in a Calculation

I have a somewhat convoluted problem that I could easily solve in Excel but I need the processing power of BI. To simplify, the company makes a general assumption that a piece of equipment can produce 10 widgets daily. So if a plant produces 100 widgets, it is assumed the location has 10 machines. We have numerous locations, but i have a measure that calculates machines per location.

 

However, a location may be effecient and produce 100 units, but they only have 8 machines. I would like the user to be given the option of using the calculated machines, or "inputting" the actual. I have created a seperate table listing values 1 - 20 as the actual machines.

 

My thought would be a slicer to determine, use calculated, or use actual.

 

If use actual, then use the drop down on a second slicer to allow the user to select the actual units.

 

The result in the visual would be widgets per unit. The assumption would be 10 widgets per machine, but the user selects, use actual, and then selects 8 machines, and thus it would be 12.5 units per machine.

 

Or is there a better way?

 

HELP!  

1 ACCEPTED SOLUTION

Hi, @dkalina97 

 

I don't know what's wrong with my calculations and didn't get the 7.19 result. But you can refer to this method of selecting input values.

Measure = 
Var _Sessions=CALCULATE(SUM('Table'[Total Sessions]))
Var _Location=13
Var _Days=CALCULATE(DISTINCTCOUNT('Table'[Actual Ship Date]),FILTER(ALL('Table'),[Total Sessions]<>BLANK()))
return
_Sessions/_Location/_Days
Measure 2 = DIVIDE([Measure],SELECTEDVALUE('actual machines'[actual machines]))

vzhangti_0-1654507430964.pngvzhangti_1-1654507445068.png

Do you want the output of this?

 

Best Regards,

Community Support Team _Charlotte

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

5 REPLIES 5
dkalina97
Helper I
Helper I

In Excel i would simply have an input call and if(Input = "",assumed qty, input qty).

v-zhangti
Community Support
Community Support

Hi, @dkalina97 

 

Is it possible to share your example data in Excel? and what you expect the output to be. Please remove sensitive information in advance if you have it.

 

Best Regards,

Community Support Team _Charlotte

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

dkalina97_0-1654260239538.png

Aboved is a very stripped down version of the customer summary. Essentially we sell 3 types of machines. It is assumed if the customer purchases the units for a type, they have 1. So for this account, there are 13 total locations, of which 7 are buying type 1 products and 10 are buying type 2. We know how many user sessions each sale provides, thus we know the assumed sessions per day. I would like the user to be able to override the actual number of machines (if it is known) so they can see an actual sessions per machine.


The attached for customer 13178 has 2 different unit types. I can calculate sessions per day and sessions per unit, with the assumption that they have 1 of each machine. But perhaps they actually have 3 machines, then the sessions per machine would change.


So I would like an option for a user to change the measure, so that rather than dividing buy the assumed quantity, they can select the actual units and use that as the denominator.

Hi, @dkalina97 

 

I don't know what's wrong with my calculations and didn't get the 7.19 result. But you can refer to this method of selecting input values.

Measure = 
Var _Sessions=CALCULATE(SUM('Table'[Total Sessions]))
Var _Location=13
Var _Days=CALCULATE(DISTINCTCOUNT('Table'[Actual Ship Date]),FILTER(ALL('Table'),[Total Sessions]<>BLANK()))
return
_Sessions/_Location/_Days
Measure 2 = DIVIDE([Measure],SELECTEDVALUE('actual machines'[actual machines]))

vzhangti_0-1654507430964.pngvzhangti_1-1654507445068.png

Do you want the output of this?

 

Best Regards,

Community Support Team _Charlotte

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

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors