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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
jrhessey
Frequent Visitor

Dax Filter Using slicer/Chiclet Value?

I'm trying to a plly a chiclet/slicer value to a dax filter fomula.

 

I found a post on here that I thought would work, but it's not returning the correct value

GetChicletValue = Var Select_Slicer = CALCULATE ( MIN ( DSO_All[CustGroup] ), ALLSELECTED( DSO_All ) )
Return Select_Slicer
 
FilterInCorrect.jpg
 
The value that should be returned in the "First GetChicletValue" is OE, not AFT.
 
What I'm trying to do is pass that value on to another formula to get the previous row for a specific customer group (replace the "oe" with the slicer/chiclet value).
 
PreviousTotalOpen =
var PreviousDate = MAXX(FILTER(ALL(DSO_All),EARLIER(DSO_All[RunDate]) > DSO_All[RunDate] ),DSO_All[RunDate])
//return PreviousDate
Return CALCULATE(SUM(DSO_All[Calculated_OPENSALEDOLLAR]),FILTER(DSO_All,DSO_All[RunDate] = PreviousDate), DSO_All[CustGroup]="oe")
 
Am I on the right track or out in left field?
 
Thanks for any help, it's greatly appreciated!!
1 ACCEPTED SOLUTION

@jrhessey 

 

Make sure it is a measure, not calculated column. Besides, take a good look at https://www.sqlbi.com/articles/filter-arguments-in-calculate/.

Community Support Team _ Sam Zha
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

3 REPLIES 3
parry2k
Super User
Super User

@jrhessey try this measure

 

GetChicletValue =SELECTEDVALUE ( DSO_ALL[CustGroup] )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 

 

How do I pass that value in to the following formula?

 

PreviousTotalOpen =
var PreviousDate = MAXX(FILTER(ALL(DSO_All),EARLIER(DSO_All[RunDate]) > DSO_All[RunDate] ),DSO_All[RunDate])
//return PreviousDate
Return CALCULATE(SUM(DSO_All[Calculated_OPENSALEDOLLAR]),FILTER(DSO_All,DSO_All[RunDate] = PreviousDate), DSO_All[CustGroup]="oe")
 
I want to replace the "oe" with the selected value.  I tried 
 
DSO_All[CustGroup]=GetChicletValue
 
but I get the error that "a calculate function has been used in a true/false expression that is used as a table filter expression. this is not allowed."
 
So I tried setting a variable 
 
Var Select_Slicer = SELECTEDVALUE( DSO_All[CustGroup] )
and using this code
DSO_All[CustGroup]=Select_Slicer
 
I don't recieve any errors, but the column goes blank.
 
Here is the end goal, whatever values I select i nthe CustGroup and ForecastCode chiclet/slicers should be inserted into the appropriate section of the formula where "custgroup" or "forecastcode".
 
So I could have selected OE and AFT for custgroup and A and B for forecastcode for example.  All those rows should be returned for the top table to sum, etc.  
 
ScreenShot-20191218 122426.jpg
 
Hopefully this makes it a little more clear.  Thanks for your help @parry2k!!

@jrhessey 

 

Make sure it is a measure, not calculated column. Besides, take a good look at https://www.sqlbi.com/articles/filter-arguments-in-calculate/.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors