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.
Hi,
I am new to Power Bi and attempting to learn how to calculate DATESBETWEEN (Status Not Started and Status Completed/Denied).
I feel completely lost. Can anyone help?
Solved! Go to Solution.
Hi @chilton ,
You can try this method:
Sample data:
Because the function Datesbetween return a table which has a single column, so you should create a table:
NotStartedBetweenDenied =
var _Den = CALCULATE(MAX('Table'[Date]), FILTER('Table','Table'[Status] = "Denied"))
var _NOTS = CALCULATE(MIN('Table'[Date]), FILTER('Table','Table'[Status] = "Not Started"))
return
DATESBETWEEN('Table'[Date], _NOTS, _Den)
NotStartedBetweenCompleted =
var _Com = CALCULATE(MAX('Table'[Date]), FILTER('Table','Table'[Status] = "Completed"))
var _NOTS = CALCULATE(MIN('Table'[Date]), FILTER('Table','Table'[Status] = "Not Started"))
return
DATESBETWEEN('Table'[Date], _NOTS, _Com)
The result is:
For more information about this function, you can refer this method:
DATESBETWEEN function (DAX) - DAX | Microsoft Learn
Hope this helps you.
Here is my PBIX file.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @chilton ,
You can try this method:
Sample data:
Because the function Datesbetween return a table which has a single column, so you should create a table:
NotStartedBetweenDenied =
var _Den = CALCULATE(MAX('Table'[Date]), FILTER('Table','Table'[Status] = "Denied"))
var _NOTS = CALCULATE(MIN('Table'[Date]), FILTER('Table','Table'[Status] = "Not Started"))
return
DATESBETWEEN('Table'[Date], _NOTS, _Den)
NotStartedBetweenCompleted =
var _Com = CALCULATE(MAX('Table'[Date]), FILTER('Table','Table'[Status] = "Completed"))
var _NOTS = CALCULATE(MIN('Table'[Date]), FILTER('Table','Table'[Status] = "Not Started"))
return
DATESBETWEEN('Table'[Date], _NOTS, _Com)
The result is:
For more information about this function, you can refer this method:
DATESBETWEEN function (DAX) - DAX | Microsoft Learn
Hope this helps you.
Here is my PBIX file.
Best Regards,
Community Support Team _Yinliw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |