Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Sort by Another Column error message for Date field

Hello, I'm new to Power BI. Very simple issue: Ive created two slicers: by Year and by Month. Have a date field in the table. Created new fields Month (number), Year (number), Month Name. I want my M...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hello, thank you for your response. Below are how I've created my columns based on OrderDate:

    Year = YEAR(<table>[OrderDate])

    Month = MONTH(<table>[OrderDate])

    MonthName = FORMAT(DATE(1,<table>[Month],1),"MMM")

     

    When I have just one year- your scenario works. But for the span of multiple years I get that error message. So I've found the solution. Created 2 new fields: one like yyyymm (integer), another yyyy/ <month name>. It works