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.
Hi,
I am trying to filter the date >=2021 , but the syntax below didn't work. Can you please help with this since I am new to DAX.
FILTER ('Backlog','Backlog'(Year([Order Date])) >= 2021
Thanks
Hi @kt3734 ,
Are you able to set your Order Date type to Date instead of text? That's what I would do.
Here is more information about the Year function.
https://learn.microsoft.com/en-us/dax/year-function-dax
When the date argument is a text representation of the date, the function uses the locale and date time settings of the client computer to understand the text value in order to perform the conversion. Errors may arise if the format of strings is incompatible with the current locale settings. For example, if your locale defines dates to be formatted as month/day/year, and the date is provided as day/month/year, then 25/1/2009 will not be interpreted as January 25th of 2009 but as an invalid date.
Thank your for your reponse. I got the error below, the reason is the column order date is text (2/3/2021 9:00:00 AM)
DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.
my order date from the table is this format: 2/3/2021 9:00:00 AM, I want to get
year(order date) = 2021
and date format: 2/3/2021
I try both below but didn't work. Can you show me how to get the correct syntax below?
FILTER ('Backlog',YEAR('Backlog'([Order Date])) >="2021"
FILTER ('Backlog',DATEVALUE('Backlog'([Order Date])) >="1/1/221"
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
14 | |
11 | |
8 |
User | Count |
---|---|
24 | |
19 | |
12 | |
11 | |
10 |