Forum Discussion

Chandrashekar's avatar
Chandrashekar
Resolver III
2 years ago
Solved

WeekNum vs Month

Hello,

am looking for column formula. If week number continuous to next month I need to get previous month.

 

Link: Sample file 

 

Regards,

Chandrashekar B

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Chandrashekar 

     

    I added the comment:

    Column = 
    
    VAR _A = CALCULATE (
            MIN ( 'Table'[Month] ),
            FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Week] = EARLIER ( 'Table'[Week] ) )
        )
        //Get the min date of every week, for examnple, the 16th week is 2024-04-15
    RETURN FORMAT(_A,"MMM-YY")
    //format the column to "MMM-YY"

     The outcome of variable _A:

     

     

    Best Regards

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

7 Replies

  • aduguid's avatar
    aduguid
    Memorable Member

    Can you post an example of what you expect to see?

    • Chandrashekar's avatar
      Chandrashekar
      Resolver III

      Hello,

       

      Expected result is in sample pbix file(already shared). am looking for column formula(new column) If week number continuous to next month I need to get previous month.

      Link: Sample file 

       

      Regards,

      Chandrashekar B

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Chandrashekar 

         

        Your files are set with access permissions, and I'm requesting access.

         

        Best Regards

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