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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Parse a slicer through a DAX command

Hey folks,

I am trying to parse a slicer though a DAX command and what I have tried so far hasn't work thus I would appreciate any help on this.

 

I have a "CALCULATE" command in a formula that looks like this

'

Baseline = CALCULATE(COUNTA('NewTable'[ID]),
filter(NewTable,NewTable[Base].[Date]=newesttable[End Time].[Date]
&&
CONTAINSSTRING(NewTable[Group], "*Attribute1*") = TRUE())
)
The current way I build this report is I create a new table for every "Atrribute1" and replace with appropriate attribute. Attribute1 is a string variable.
A new request was made for a slicer, especially as said report should contain 80 different attributes!!
 
The approach adopted so far has been to create a measure. The measure calculation is measure2 =SelectedValue(Attributes).
 
I have tried the following, but got no result.
1.
Baseline = CALCULATE(COUNTA('NewTable'[ID]),
filter(NewTable,NewTable[Base].[Date]=newesttable[End Time].[Date]
&&
CONTAINSSTRING(NewTable[Group], measure2) = TRUE())
)
 
2. I also tried this:
var val=SELECTEDVALUE(NewTable[CREWGROUP])
return
CALCULATE(COUNTA('NewTable'[ID]),
filter(NewTable,NewTable[Base].[Date]=newesttable[End Time].[Date]
&& 
NewTable[GROUP] = val).
 
Option 1 pretty much attempts to make the dax formular reference the measure, while option 2 tries to make the dax formular reference the selection on the page. But have been unsuccessful.
 
Any recommendation of a better way of doing this? A way to make a DAX command harvest the selection on a slicer?
 
Thanks.
 
1 REPLY 1
lbendlin
Super User
Super User

You may be overcomplicating things.  Use the FILTERS() function, and then INTERSECT() etc as needed.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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