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
Hi,
I have this calc col -> Punctuality = IF (OTIF[ShiftInTime]<OTIF[TimeFrom]-1/24*.25,"Early",
IF (OTIF[ShiftInTime]>OTIF[TimeFrom]+1/24*.25,"Late","On Time"
& IF (OTIF[ShiftInTime]>OTIF[TimeFrom]+1/24*1,"Perfect")))
I have this measure -> targetperc OT = LASTNONBLANK('OT%'[OT%],0.25)
I substitute the *.25 in th calc col with * targetperc OT to give me ->
Punctuality = IF (OTIF[ShiftInTime]<OTIF[TimeFrom]-1/24*[targetperc OT],"Early",
IF (OTIF[ShiftInTime]>OTIF[TimeFrom]+1/24*[targetperc OT],"Late","On Time"
& IF (OTIF[ShiftInTime]>OTIF[TimeFrom]+1/24*1,"Perfect")))
I have applied the values in OT% table to a slicer. However, when I select values in the slicer, nothing changes. Below is the table my measure is using.
What am I missing here?
Thanks for uploading the pbix.
Two things.
targetperc OT = LASTNONBLANK('OTP%'[OTP%],0.25)
Early = COUNTROWS ( FILTER ( OTIF, IF ( OTIF[ShiftInTime] < OTIF[TimeFrom] - 1 / 24 * [targetperc OT], "Early", IF ( OTIF[ShiftInTime] > OTIF[TimeFrom] + 1 / 24 * [targetperc OT], "Late", "On Time" & IF ( OTIF[ShiftInTime] > OTIF[TimeFrom] + 1 / 24 * 1, "Perfect" ) ) ) = "Early" ) )
Use of Parameters would be more appropriate solution in your case.
Parameters? Can you tell me how I can do this?
Can you please provide me a snapshot your dataset and I would be more than happy to provide you exact solution.
Here's my file. I had a go at adding a parameter and applying the values in my OT% table to it. Parameter name is OTP%.
Hi Android1,
Firstly you have to create parameter ( list of values) based on your IF% Table.
This can be done in powerquery mode. Pass on all the list of the values of IF% Table.
create a new custom column,
Pass on your formula you created before and replace the value of 0.25 with Parameter name.
This will let you choose the value later on dynamically and you can select the value of your choice.
Hope this will clarify your problem. I was unable to create this for you because of connection settings.
You have to slightly change the formula for custom column as PowerQuery works on IF logic but have to add else statment too.
Let me know if you get stuck further.
Hi
You can not use measure in calculated column. you need to come up with some other logic.
Ah, ok. Thank you.
Try changing the column data format to "general".
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 |
---|---|
126 | |
85 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |