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.