Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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"
)
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors