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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.