March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Pretty new to PowerBI and DAX.
I currently have a calculated column that is calculating time to depth using assumed run speeds for the vertical section and lateral section of a well. The depths and lengths are 2 columns in my table. A team member requested that they be able to adjust the assumed speeds to see time savings by running in faster.
I discovered what if parameters, which is exactly what I want, however columns evaluate at load time, not run-time.
So, my question is, is there a way to convert a fairly simple calculation into a measure so I can make this happen?
Time_To_Depth = (depth/runSpeedA + length/runSpeedB)/60
Solved! Go to Solution.
Time_To_Depth as measure = var d = SUM(depth) var l = SUM(Length) var mycal = DIVIDE(d, [What if parameter for speed a], 0) + DIVIDE(l, [What if parameter for speed b], 0) return DIVIDE(myCal, 60, 0)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Time_To_Depth as measure = var d = SUM(depth) var speedA = SUM(runSpeedA) var l = SUM(Length) var speedB = SUM(runSpeedB) var mycal = DIVIDE(d, runSpeedA, 0) + DIVIDE(l, runSpeedB, 0) return DIVIDE(myCal, [what if parameter name], 0)
try above, add it it as a measure.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Forgot to mention that runspeed a and b would be the what if parameters. So I've got this in and its giving me pretty different results compared to my calculated colum with static values for the run speeds.
Time_To_Depth as measure = var d = SUM(depth) var l = SUM(Length) var mycal = DIVIDE(d, [What if parameter for speed a], 0) + DIVIDE(l, [What if parameter for speed b], 0) return DIVIDE(myCal, 60, 0)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Ok. Continuing on further, I am taking this theoretical value, and comparing it to an actual run time. Then trying to convert it to a percent off of the theoretical.
Design Time Variance =
var tvd =averagea('Perf Data'[AVERAGE TVD])
var md = averagea('Perf Data'[Average MD])
var design = (divide(tvd,'Run In Speed - Vertical'[Run In Speed - Vertical Value],0)+DIVIDE(md-tvd,'Run In Speed - Lateral'[Run In Speed - Lateral Value],0)+DIVIDE(md,'Run Out Speed'[Run Out Speed Value]))/60
var actual = AVERAGE('Perf Data'[Wireline Duration])
var difference = actual-design
var percentage = DIVIDE(difference,design,0)
return percentage
When I return the difference var, the values match my calculated columns, but the percentages don't match. Any ideas why?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
84 | |
66 | |
54 | |
43 |
User | Count |
---|---|
203 | |
106 | |
98 | |
65 | |
56 |