Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Justas4478
Post Prodigy
Post Prodigy

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

 

Year table.PNG

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

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"
)

Eyelyn9_0-1656383694329.png

 

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.

View solution in original post

6 REPLIES 6
v-eqin-msft
Community Support
Community Support

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"
)

Eyelyn9_0-1656383694329.png

 

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.

Justas4478
Post Prodigy
Post Prodigy

@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.

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


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

Hariharan_R
Solution Sage
Solution Sage

Hi @Justas4478 

 

Try group option.

Hariharan_R_0-1655822224644.png

 

Hariharan_R_1-1655822245148.png

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


amitchandak
Super User
Super User

@Justas4478 , You need to create a new column of dynamic segmentation

 

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.