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

Making a date scheduler based on results of another column.

Hello PBI community. I am trying to make a date scheuler meausre based off of what customers are entitled to. 

For example - if the customer is entitled to 2 birs - dateadd 6 months and if the customer is entitled to 3 birs then dateadd 4 months. 

I am pushing out the Due Date for the customers by such increments and I have set a MAX bir entitlement for the customers as some customers may be entitled to 2 or 3 depending on history , I am basing the push out by their MAX entitlement. For some reason I am constantatly getting errors. I have attached my DAX forumla I am trying, any help ? Thanks in advance. 

DAX formulaDAX formula

 

7 REPLIES 7
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Sample data will look like this: 

Customer Name SeatsBIR RangeBIR Due DateBIR Entitlement
A300250-99906/02/20222
B15001000 or more08/08/20223
C270250-99912/31/20222      

Sample outcome should be this: Logic 

Customers entitled to 2 BIR's recieve a BIR EVERY 6 MONTHS , Customers with 3 BIRs are entitled to one every 4 months. The date should be pushed out in a cadence FROM the Due Date.

Customer Name SeatsBIR RangeBIR Due DateBIR EntitlementNext BIR Date 
A300250-99906/02/2022212/02/2022
B15001000 or more08/08/2022312/08/2022
C270250-99912/28/20222      06/28/2022

Hi,

This calculated column formula work

=if(Data[BIR Entitlement]=2,EDATE(Data[BIR Due Date],6),EDATE(Data[BIR Due Date],4))

Hope this helps.

Untitled.png


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

Hi, @tyannamorrison 

 

You can try the following methods.

Next BIR Date =
IF (
    [BIR Entitlement] = 2,
    IF (
        MONTH ( [BIR Due Date] ) > 6,
        DATE ( YEAR ( [BIR Due Date] ) + 1, MONTH ( [BIR Due Date] ) + 6 - 12, DAY ( [BIR Due Date] ) ),
        DATE ( YEAR ( [BIR Due Date] ), MONTH ( [BIR Due Date] ) + 6, DAY ( [BIR Due Date] ) )
    ),
    IF (
        [BIR Entitlement] = 3,
        IF (
            MONTH ( [BIR Due Date] ) > 8,
            DATE ( YEAR ( [BIR Due Date] ) + 1, MONTH ( [BIR Due Date] ) + 4 - 12, DAY ( [BIR Due Date] ) ),
            DATE ( YEAR ( [BIR Due Date] ), MONTH ( [BIR Due Date] ) + 4, DAY ( [BIR Due Date] ) )
        )
    )
)

vzhangti_0-1652859847022.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much for this solution, there were no syntax errors and ran smoothly. Unfortenatly when I added it to the visual I ran into an error. Both measures that are being used is a date type column(MAX Due Date) and for some odd reason the measure (MAX BIR) only has the format option of text - would this cause the issue I am facing?

image.png 

tyannamorrison_1-1652987706421.png

 

Hi, @tyannamorrison 

 

You can check the following blog and choose a way to pass your files.

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, @tyannamorrison 

 

Are you able to provide PBIX files for testing? Sensitive information can be removed in advance. With this error report screenshot alone, it is not possible to directly determine the cause of the error.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.