Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I want to get a column that automatically says if the month is current or not. So as to make a filter based on it.
I used a function that works really well for years:
if Date.Year(DateTime.LocalNow() )= [Year] then "Current year" else Text.From ([Year])
if Date.Month(DateTime.LocalNow() )= [Month] then "Current month" else Text.From ([Month]) generates an error.
I suppose the month column has to be formatted in specific way, which might be impacted by the region of the user. Should it be text, then in English? Or in the local language? Or do I have to use a number, then in which format? My tests don't work so far.
Can anyone help me with this?
Thanks,
Pauline.
Solved! Go to Solution.
@Ahmedx Thank you so much! Seems straightforward once you know the function exists 🙂 You saved my day!
and this last month
pls try
Int64.From(
Date.IsInCurrentMonth([Business Days]))
User | Count |
---|---|
84 | |
77 | |
76 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
45 | |
43 |