Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all, I am new to PBI, and have been following a turorial on creating a calculated column for banding activity periods. I have a simple spreadsheet of invoice dates and report dates which should allow me to calculate how many days between Invoice Date and Report date, AND which band each invoice falls into. I have entered the formula as per the tutorial (I think!) : -
Ageing = SWITCH(TRUE(),
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=0,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY<=15)),"0-15 days",
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=16,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY<=30)),"16-30 days",
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=31,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)<=60),"31-60 days",
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>60,"60+")
For some reason I am getting an error message: -
"The third argument Interval can only be one of the following: YEAR, QUARTER, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND."
Grateful for a steer 🙂
Solved! Go to Solution.
Wrong place for )
Ageing = SWITCH(TRUE(),
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=0,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)<=15),"0-15 days",
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=16,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)<=30),"16-30 days",
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=31,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)<=60),"31-60 days",
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>60,"60+")
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Wrong place for )
Ageing = SWITCH(TRUE(),
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=0,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)<=15),"0-15 days",
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=16,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)<=30),"16-30 days",
AND(DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>=31,
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)<=60),"31-60 days",
DATEDIFF(Sheet1[Invoice Date],Sheet1[Report Date],DAY)>60,"60+")
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Hi Amitchandak, Many thanks, great spot!
Kind regards,
Mila.
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
68 |
User | Count |
---|---|
113 | |
105 | |
84 | |
65 | |
64 |