Forum Discussion

eduardosilvin3's avatar
2 years ago
Solved

Filter by week number

Hello all, I created a week numb colmn  "Week numb = WEEKNUM('Calendar'[Date], 1)" from the calendarauto table, and then I created a measure for indicate the filtered dated "

Selected Dates =
"      You have filtered dates from      "
& FORMAT(MIN('Calendar'[Date].[Date]), "'Ddd dd Mmm yy'")
& " to "  
& FORMAT(MAX('Calendar'[Date].[Date]), "'Ddd dd Mmm yy'")    "
 
I have 2 filters: months and number(direct from the calendar auto) of weeks(caluculated column mentioned above), but when I filter by weeks other elements are filtered, but the text with the filtered dates is not reacting, just with the filter of months. Any help?
 

 

 
Regards
Eduardo
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi eduardosilvin3 ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

     

    CALENDAR Table = ADDCOLUMNS(CALENDAR(DATE(2023,1,1),DATE(2023,12,31)),"Week",WEEKNUM([Date],1),"Month",FORMAT([Date],"mmmm"))

     

    (2) We can create a measure. 

     

    Selected Dates = 
    "      You have filtered dates from      "
    & FORMAT(FIRSTDATE('CALENDAR Table'[Date]), "'Ddd dd Mmm yy'")
    & " to "  
    & FORMAT(LASTDATE('CALENDAR Table'[Date]), "'Ddd dd Mmm yy'") 

     

    (3) Then the result is as follows.

     

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi eduardosilvin3 ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

     

    CALENDAR Table = ADDCOLUMNS(CALENDAR(DATE(2023,1,1),DATE(2023,12,31)),"Week",WEEKNUM([Date],1),"Month",FORMAT([Date],"mmmm"))

     

    (2) We can create a measure. 

     

    Selected Dates = 
    "      You have filtered dates from      "
    & FORMAT(FIRSTDATE('CALENDAR Table'[Date]), "'Ddd dd Mmm yy'")
    & " to "  
    & FORMAT(LASTDATE('CALENDAR Table'[Date]), "'Ddd dd Mmm yy'") 

     

    (3) Then the result is as follows.

     

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

    • eduardosilvin3's avatar
      eduardosilvin3
      Helper II

      I changed the MAX and MIN for FIRSTDATE and LASTDATE and start working as I wanted, thank you so much!