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
Sarath5c8
Frequent Visitor

Need a conditional Logic to label based on Dimension

In the below mentioned screenshot, desired output is the label which is condition if within Product if the Status is changed from Null (thats the initial status which will be assigned) to a string P1 and its create date is 4/8/22 that means if within product if the status changes from Null to any value it should be Labelled "New" , else if with Product if it changes from some value P1 to P12 then it should be labelled "Existing".

 

In.PNG           Out.PNG

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula.  For Bench (status JOU14), the result should be New because the status as on the previous date was Null.

Label = if(Data[Status]="Null",BLANK(),if(lookupvalue(Data[Status],Data[Date],CALCULATE(MAX(Data[Date]),FILTER(Data,Data[Product]=EARLIER(Data[Product])&&Data[Date]<EARLIER(Data[Date]))),Data[Product],Data[Product])="Null","New","Existing"))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula.  For Bench (status JOU14), the result should be New because the status as on the previous date was Null.

Label = if(Data[Status]="Null",BLANK(),if(lookupvalue(Data[Status],Data[Date],CALCULATE(MAX(Data[Date]),FILTER(Data,Data[Product]=EARLIER(Data[Product])&&Data[Date]<EARLIER(Data[Date]))),Data[Product],Data[Product])="Null","New","Existing"))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Sarath5c8
Frequent Visitor

@amitchandak or @johnt75 can you help

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.