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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ali02
Frequent Visitor

ABC analysis with Slicer filter

Hi everyone,

 

So I have been wroking on ABC segmentation and did manage to create one. Now everytime if I need to filter my class, I have to go back again to the formula and change it. For e.g,

 

ABC Class = SWITCH (TRUE (),[Cumulated %]<= 0.8, "A",[Cumulated %] <= 0.95, "B","C")

 

Above is my DAX formula. So everytime I need to go back to the formula to change my Cumulated% value i.e. 0.8 to 0.75 for A.

I want to create a slicer filter where I can change the values right on the visuals and that would change my ABC class. I have not found anything on the internet regarding this. Any help would be highly appreciated.

1 ACCEPTED SOLUTION

Hi @ali02,

 

You can add new table as the source of slicer, then use result as the variables of original formula.

 

Sample:

Source table:

Table = GENERATESERIES(0,1,0.01)

 

Measure formulas:

Selected = 
var _min= MINX(ALLSELECTED('Table'),[Value])
var _max=MAXX(ALLSELECTED('Table'),[Value])
return
_min&"/"&_max


ABC Class =
VAR _min =
    MINX ( ALLSELECTED ( 'Table' ), [Value] )
VAR _max =
    MAXX ( ALLSELECTED ( 'Table' ), [Value] )
RETURN
    SWITCH ( TRUE (), [Cumulated %] <= _min, "A", [Cumulated %] <= _max, "B", "C" )

6.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

What you want is to go to the Modeling tab and click on New Parameter.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Even if I do create a New Parameter, I still need to make sure that if I change my parameter values, my cumulative values changes as well as ABC Class.  

 

These are my initial conditions.

 pic1.PNG

 

These are what I want if I change my parameters or create a slicer and filtering it. But I am not able to create something that will give me these values. I have to go back to the formula everytime to change the conditions. I want to create filter so that the user can easily change the value.

 

pic2.PNGpic3.PNG

 

Hi @ali02,

 

You can add new table as the source of slicer, then use result as the variables of original formula.

 

Sample:

Source table:

Table = GENERATESERIES(0,1,0.01)

 

Measure formulas:

Selected = 
var _min= MINX(ALLSELECTED('Table'),[Value])
var _max=MAXX(ALLSELECTED('Table'),[Value])
return
_min&"/"&_max


ABC Class =
VAR _min =
    MINX ( ALLSELECTED ( 'Table' ), [Value] )
VAR _max =
    MAXX ( ALLSELECTED ( 'Table' ), [Value] )
RETURN
    SWITCH ( TRUE (), [Cumulated %] <= _min, "A", [Cumulated %] <= _max, "B", "C" )

6.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.