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
Anonymous
Not applicable

How can i recreate this logic in Power BI ?

The visual is providing user to interact with the data using the parameter. they can select parameter value(DueInDays)ranging from 1-30 days and then see the number of jobs due as per selection. 

For eg ; if the user is selecting 3 , they will be able to see the number of jobs due in next 3 days .

 

Logic behind :- In tableau i am passing the parameter value selected by the user in one of the calculated field :

IF [Status] <> "Completed" THEN

if(DATEDIFF('day',DATEADD('day',int([DueInDays]),NOW()), [Due Date])<0 AND isnull([Date Completed]))
THEN "Overdue"
ELSE "Not Due"
END
ELSE
"Completed"
END

and its helping the view to update everytime user is selecting different value .

 

Capture.PNG

 

4 REPLIES 4
amitchandak
Super User
Super User

Try like

 IF ([Status] <> "Completed" ,if(datediff(Today()+ ([DueInDays]*1), [Due Date],day)<0 && isblank([Date Completed]), "Overdue"
, "Not Due"
)
,
"Completed"
)
Anonymous
Not applicable

Hi Amit, 

   I created the new column but the values are not changing when I am updating the DueInDays parameter value from the report view .

Then you need a measure.Can you share sample data and sample output. If possible please share a sample pbix file after removing sensitive information.Thanks.

@Anonymous 

You need to rework it as measure, something like this and context would (row) also be important 

  IF (firstnonblank([Status],blank()) <> "Completed" ,if(datediff(Today()+ (max('DueInDays'[DueInDays])*1), [Due Date],day)<0 && isblank(firstnonblank([Date Completed],blank())), "Overdue"
, "Not Due"
)
,
"Completed"
)

 

Refer how to manage row context in my blog

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Difference-Across/ba-p/934397#M451

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.