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.
Hello 🙂
I am currently trying to create a column for the current month. I have created a DimDate Table where i want the column to be. I have used the following code to make a yes/no indication according to, if the month is the current month. I have used the following code:
IsToday = var Currentrowdate = FORMAT(DimDate[Date]; "mm/yyyy") var istoday = FORMAT(NOW(); "mm/yyyy") return IF(istoday = Currentrowdate; "Yes"; "No")
I would like the current month to start from the 16th-15th in the next month. So for example from the 16th of July to the 15th of August. It should be possible to auto update the current month, so that code have to be dynamic.
Thank you in advance 🙂
Solved! Go to Solution.
@Anonymous
I found a way to make it work! I just changed your code a bit. Thank you so much! the code is:
FNyear = Var First = FORMAT(IF(DimDate[DayofMonth]>=16;DATE(DimDate[år];DimDate[Monthof Year]+1;16);IF(DimDate[DayofMonth]<=15;DATE(DimDate[år];DimDate[Monthof Year];16)));"MM/YYYY") var second = FORMAT(NOW();"MM/YYYY") return IF(First = second;"yes";"No")
hi @Anonymous ,
see this one,
Hi @Anonymous
I found a solution! 😄
the code is :
Lastmonth = Var First = FORMAT(IF(DimDate[DayofMonth]>=16;DATE(DimDate[år];DimDate[Monthof Year]+2;16);IF(DimDate[DayofMonth]<=15;DATE(DimDate[år];DimDate[Monthof Year]+1;16)));"MM/YYYY") var second = FORMAT(NOW();"MM/YYYY") return IF(First = second;"yes";"No")
Thank you so much for your help ! 😄
@Anonymous
I found a way to make it work! I just changed your code a bit. Thank you so much! the code is:
FNyear = Var First = FORMAT(IF(DimDate[DayofMonth]>=16;DATE(DimDate[år];DimDate[Monthof Year]+1;16);IF(DimDate[DayofMonth]<=15;DATE(DimDate[år];DimDate[Monthof Year];16)));"MM/YYYY") var second = FORMAT(NOW();"MM/YYYY") return IF(First = second;"yes";"No")
hi @Anonymous ,
Try this formula,
hi @Anonymous
It almost works! 😄
I want the current month to start from the 16th of last month. So from the 16th of july. The code you have provided gave me the current month from the 16th of august. I have tried to change the code but i can not get it to work so that the start of the month is for the 16th of last month.
hi @Anonymous ,
see this one,
Hi @Anonymous
I found a solution! 😄
the code is :
Lastmonth = Var First = FORMAT(IF(DimDate[DayofMonth]>=16;DATE(DimDate[år];DimDate[Monthof Year]+2;16);IF(DimDate[DayofMonth]<=15;DATE(DimDate[år];DimDate[Monthof Year]+1;16)));"MM/YYYY") var second = FORMAT(NOW();"MM/YYYY") return IF(First = second;"yes";"No")
Thank you so much for your help ! 😄
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 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |