Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
97 | |
69 | |
46 | |
39 | |
33 |
User | Count |
---|---|
163 | |
110 | |
61 | |
51 | |
40 |