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
EmilijaN
Helper I
Helper I

How to put additional rule in the code below

Hello guys, 

 

I need help with this code:

FuelAmount_Monthly =
Var
Pomosna1=MINX(FILTER(Trip_Activity,Trip_Activity[Month&Year]=EARLIER(Trip_Activity[Month&Year]) && Trip_Activity[ID]=EARLIER(Trip_Activity[ID])),Trip_Activity[Index])
var
Pomosna2=CALCULATE (
SELECTEDVALUE ( FuelAmount_Monthly[sum]),
FILTER (
FuelAmount_Monthly,(FuelAmount_Monthly[Month&Year]=Trip_Activity[Month&Year] && FuelAmount_Monthly[ID]=Trip_Activity[ID]
)))
return

if([Index]=Pomosna1, Pomosna2,BLANK())
 
What exactely I need is: I need the rows that are not maching the code. Or, if there is rows that are not meching by ID, than try with TruckId. But I do not know how to put rule with TruckId in this code.
 
Any suggestions?
 
Thank you!
1 REPLY 1
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

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.