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
Anonymous
Not applicable

Convert measure as slicer and filter

Hi all, 

 

I have a measure that is showing the correct values, and that measure needs to be a filter/slicer. But when I try to create a calculated column with the logic that I have in that measure, it is not working properly: 

I've these measures:
1- gpal logic measure=
VAR gpal_lp = [Gpal LP_]
VAR gpal_cp = [GPAL_]
VAR logicgpal =
IF (
gpal_lp = 0,
IF ( gpal_cp = 0, 0, 1 ),
IF (
gpal_lp < 0,
( -1 * ( gpal_cp - gpal_lp ) / gpal_lp ),
( gpal_cp - gpal_lp ) / gpal_lp
)
)
RETURN
logicgpal

2- gpal filter measure

IF([gpal logic measure]<= -0.5,"< -50%",

IF([gpal logic measure]<= -0.25, "-50% - -25%",

IF([gpal logic measure]< 0, "-25% - 0%",

IF([gpal logic measure]= 0, "0%",

IF([gpal logic measure] < -0.25,"0% - 25%",

IF([gpal logic measure]<0.50,"25% - 50%", "> 50%")

)))))


And when I try to aggregate both measures and create a 3 - calculated colum (gpal column filter wrong) to use as filter, it is not working well: 
Capture.JPG

Is there any workaround for this?

Kind regards. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , for this you need to do dynamic segmentation or binning.

 

Please refer to my video if that can help

https://www.youtube.com/watch?v=CuczXPj0N-k

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

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Are you want to convert the measure to calculated column so that you could use the column as silcer to filter the records has different percentages?

I must say you are using multiple IF() function in the measure that makes it's hard to understand the logic about the measure.
You may try SWITCH() function instead.

Please show some sample data and the calculate logic to us so that we could help you deal with the formula.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@Anonymous , for this you need to do dynamic segmentation or binning.

 

Please refer to my video if that can help

https://www.youtube.com/watch?v=CuczXPj0N-k

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!

December 2024

A Year in Review - December 2024

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