Forum Discussion

Justas4478's avatar
Justas4478
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Year table grouped using measure

Hello, I have year table and I am trying to group it in to custom group that would have years I specify.

 

Only problem is that I can only use measures to do the grouping.

 

This is what I am trying to do.

Thanks

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Justas4478 ,

     

    Please try:

    Measure =
    SWITCH (
        TRUE (),
        MAX ( 'Table'[Year] ) >= 2017
            && MAX ( 'Table'[Year] ) <= 2020, "2017-2020",
        MAX ( 'Table'[Year] ) >= 2021
            && MAX ( 'Table'[Year] ) <= 2024, "2021-2024"
    )
    

     

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

6 Replies

  • amitchandak Hariharan_R Hi, I cant do any of the solutions provided since cube is connected using Live connection method. Therefore limiting me to only being able to use measures.

    • Hariharan_R's avatar
      Hariharan_R
      Icon for Solution Sage rankSolution Sage

      Hi Justas4478 

      I doubt on get it in measure. Measure will produce one value as a result. You may need to add Year column in the table and then measure with IF or switch statement.

       

      Thanks

      Hari

      Did I answer your question? Then please mark my post as the solution.
      If I helped you, click on the Thumbs Up to give Kudos.


      My Blog :: YouTube Channel :: My Linkedin


      • Justas4478's avatar
        Justas4478
        Icon for Post Prodigy rankPost Prodigy

        Hariharan_R I tried using switch function with measure but it does not accept date table or year column

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Justas4478 ,

     

    Please try:

    Measure =
    SWITCH (
        TRUE (),
        MAX ( 'Table'[Year] ) >= 2017
            && MAX ( 'Table'[Year] ) <= 2020, "2017-2020",
        MAX ( 'Table'[Year] ) >= 2021
            && MAX ( 'Table'[Year] ) <= 2024, "2021-2024"
    )
    

     

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