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
amaniramahi
Helper V
Helper V

Selected value in calculated column

I have a table contains the following sample data (Sensors Table)

DateTimeRPM
15/3/20201:00 PM1000
15/3/20201:02 PM1200
15/3/20202:07 PM1300
16/3/202011:40 AM2500
16/3/202012:30 PM680

 

and another table contains the following sample data (Trip table)

Trip NumberDateFromTo
Trip115/3/202012:00 PM1:30 PM
Trip215/3/20202:00 PM4:00 PM
Trip316/3/20208:00 AM1:00 PM

 

and a what if parameter (Acceleration %) for the values of RPM

 

what I need to calculate is the count of times where RPM exceeds the selected value in the what-if parameter

as long as it's the same date and during the trip interval.

 

whenever I create a calculated column using SELECTEDVALUE it does not return the correct value.

1 ACCEPTED SOLUTION

@amaniramahi well, it's not as straight forward, there are many moving parts, based on what you posted and what I understood, I created a work file (attached), take a look and adjust according to your requirement.

I'd like to💖 Compliments🙂 if my solution helped me.👉If you can spend time posting the question, you can also make efforts to give Kudos who has helped solve your problem. It's a token of appreciation!



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.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@amaniramahi you have to use selectedvalue in a measure, not calculated column.

 

 

 



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.

@parry2k  I know. that's why I am asking if there's a way to do what I want without using SELECTEDVALUE

@amaniramahi question I would ask why you want o create a calculated column not 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.

I tried, I wrote the following formula

 

Measure = 
var _SelectedAcc = SELECTEDVALUE('Over Revving Parameter'[Over Revving])
var _Qty = CALCULATE(COUNT(Sensors[RPM]),FILTER(Sensors,Sensors[Date]=

 then I stop and I cannot select the date in Trip table.

and I guess I won't be able also to add filters for time.

 

Btw, there is a third table contains date column and they are all related. 

@amaniramahi well, it's not as straight forward, there are many moving parts, based on what you posted and what I understood, I created a work file (attached), take a look and adjust according to your requirement.

I'd like to💖 Compliments🙂 if my solution helped me.👉If you can spend time posting the question, you can also make efforts to give Kudos who has helped solve your problem. It's a token of appreciation!



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.

Thank you, but the problem is the formula summed the RPM readings.

I have 5 different readings, and I need to check for every single reading if it exceeds the What-if parameter or not (not to check if their summation exceeds).

 

but did a little tweak on your  formual and it worked!

Thank you so much 

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.