Forum Discussion
Anonymous
4 years agoNot applicable
Count days if conditions met
Hi,
i would like to count the number of days if two conditions are met in the power query.. There must be an easy way to do this right?
(if column A and B = Actual then count days between Column B & D)
| Column A | Column B | Column C | Column D |
| Actual | 2022-01-01 | Actual | 2022-03-31 |
BR Patrik - new to power bi
Hi Anonymous ,
How about this:
You can add a custom column with the following code:if [Column A] = "Actual" and [Column C] = "Actual" then Duration.Days ( [Column D] - [Column B] ) else null
Let me know if this solves your issue 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
2 Replies
- tackytechtom
Most Valuable Professional
Hi Anonymous ,
How about this:
You can add a custom column with the following code:if [Column A] = "Actual" and [Column C] = "Actual" then Duration.Days ( [Column D] - [Column B] ) else null
Let me know if this solves your issue 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/- AnonymousNot applicable
Thanks you tackytechtom it works perfect!