Forum Discussion

Oki's avatar
Oki
Icon for Helper I rankHelper I
3 years ago
Solved

Quarter Value based on Date Range Filter

Hi,

i need some help with my issues,

first i want to show a quarter target in card, based on date range filter 

if the date range filter is : 
1. 1/1/2023 - 3/31/2023 = it will show Q1 target
2. 2/1/2023 - 2/31/2023 = show Q1 target
3. 1/1/2023 - 4/12/2023 = show Q2 target (because the last month on filter is April which is month in Q2
etc.

is this possible?

  • Oki , You can try a measure like

     

    format(maxx(allselected(date), Date[Date]), "\QQ")

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Oki ,

    I have created a simple sample, please refer to it to see if it helps you.

    Create a measure.

    Measure =
    VAR _1 =
        MAXX ( ALLSELECTED ( 'Table' ), 'Table'[Date] )
    RETURN
        IF ( MAX ( 'Table'[Date] ) = _1, MAX ( 'Table'[quanter] ), BLANK () )
    

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

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

6 Replies

  • Oki , You can try a measure like

     

    format(maxx(allselected(date), Date[Date]), "\QQ")

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Oki ,

    I have created a simple sample, please refer to it to see if it helps you.

    Create a measure.

    Measure =
    VAR _1 =
        MAXX ( ALLSELECTED ( 'Table' ), 'Table'[Date] )
    RETURN
        IF ( MAX ( 'Table'[Date] ) = _1, MAX ( 'Table'[quanter] ), BLANK () )
    

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

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

  • amitchandak 

     

    why  if i select from "start date" first, with range:  Feb 2023 - Apr 2023 it shows Q4
    but if i select from "end date" first then select the start date with same range ( Feb 2023 - Apr 2023 ), it shows Q2
    what i need is whatever my choice of start date or end date, it shows the same quarter

     

     

    • Oki's avatar
      Oki
      Icon for Helper I rankHelper I

      Anonymous 

      i have this problem,,
      when i select from the start date, it will give me false value
      but if i select from the end date, it works fine

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Oki ,

        What is the meaning? "when i select from the start date, it will give me false value.?

        I can not reporoduce the issue.Could  you please provide the screenshots with the error?

         

        Best Regards
        Community Support Team _ Rongtie

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