Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi everybody, looking to add a column which either gives me a 1,0 whether the statement is true or not. Below is a very rough draft of the requested DAX, but I think it'll relay what I'm trying to accomplish. Using this for a filter ultimately.
If(month([Date]) < month(today()) && year([Date]) = year(today()), 1, 0)
Thank you so much for your time.
Solved! Go to Solution.
Hi @mclawler
What is the issue with your fornula? Try this
Column =
Var _M = month(today())
Var _Y = year(today())
Return
IF(month([Date])<_M&&year([Date])=_Y,1,0)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn | Twitter | Blog | YouTube
@mclawler- Check this out.
LastCompletedMonthYTD =
IF (
YEAR ( YourTable[Date] ) = YEAR ( TODAY () )
&& MONTH ( YourTable[Date] ) = MONTH ( EOMONTH ( TODAY (), -1 ) ),
1,
0
)
If this post helps to find solution would be happy if you could mark my post as a solution and give it a thumbs up
Best regards
Manoj Nair
Linkedin - https://www.linkedin.com/in/manoj-nair-%E2%98%81-344666104/
@mclawler- Check this out.
LastCompletedMonthYTD =
IF (
YEAR ( YourTable[Date] ) = YEAR ( TODAY () )
&& MONTH ( YourTable[Date] ) = MONTH ( EOMONTH ( TODAY (), -1 ) ),
1,
0
)
If this post helps to find solution would be happy if you could mark my post as a solution and give it a thumbs up
Best regards
Manoj Nair
Linkedin - https://www.linkedin.com/in/manoj-nair-%E2%98%81-344666104/
Thank you, your DAX worked as well!!
@mclawler-Hi, If the responses provided accurately address the question you posed, it's feasible to select both of them as accepted answers in a Power BI Community post. Choice is yours. 😉
Hi @mclawler
What is the issue with your fornula? Try this
Column =
Var _M = month(today())
Var _Y = year(today())
Return
IF(month([Date])<_M&&year([Date])=_Y,1,0)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn | Twitter | Blog | YouTube
Not sure why mine wasn't working but your DAX worked perfectly. Thanks!!
Glad it worked 🙂
User | Count |
---|---|
101 | |
90 | |
79 | |
70 | |
70 |
User | Count |
---|---|
112 | |
96 | |
96 | |
75 | |
72 |