Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a two tables - one takes source direcly from SQL, and I am adding another formated in Power bi and I need to apply the same filters. And here is where my issues start
The SQL has it like this:
WHERE MONTH(date_order) = MONTH(CURRENT_DATE())#(lf)AND YEAR(date_order) = YEAR(CURRENT_DATE())
The table I have in sql comes from a different place so I need to apply this in power BI.
I created a custom column and I want to filter values 1 later:
if Date.Month([date_of_order]) = Date.Month(Date.From(DateTime.LocalNow()))
&
Date.Year([date_of_order]) = Date.Year(Date.From(DateTime.LocalNow()))
then "1" else"0"
But this gives me an error which I do not understand:
Any ideas how to fix it?
Solved! Go to Solution.
Try the below code.
if Date.Month([date_of_order]) = Date.Month(Date.From(DateTime.LocalNow()))
and
Date.Year([date_of_order]) = Date.Year(Date.From(DateTime.LocalNow()))
then "1" else"0"
Try the below code.
if Date.Month([date_of_order]) = Date.Month(Date.From(DateTime.LocalNow()))
and
Date.Year([date_of_order]) = Date.Year(Date.From(DateTime.LocalNow()))
then "1" else"0"
This worked, so seems power query does not like & signs. Thanks
User | Count |
---|---|
111 | |
105 | |
100 | |
77 | |
44 |
User | Count |
---|---|
143 | |
142 | |
122 | |
100 | |
57 |