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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rpinxt
Impactful Individual
Impactful Individual

The placeholder not allowed error

I have a slicer that I want to use to calculate an amount based on the selected slicer value:

rpinxt_0-1698748838255.png

So CG_Sel gives me the selected value and in this case 'Shipping Accuracy'.

Checked with a card, this works perfectly.

 

Now I want this name that comes out (Shipping Accuracy) to be used in this calculate function :

rpinxt_1-1698748926278.png

In the table UCL there is a field ShipGrp and it holds also the value Shipping Accuracy.

So thouht this would be pretty straight forward but DAX does not approve.

 

Anybody an idea how I could pass the outcome of the selected value as a filter for the calculate formula?

So telling that it should filter field ShipGrp on 'Shipping Accuracy'?

 

2 ACCEPTED SOLUTIONS
rpinxt
Impactful Individual
Impactful Individual

Ok...nevermind turns out that I cannot use the measure but I can use the logic that I created measure CG_Sel with....

 

This worked :

rpinxt_0-1698749265866.png

 

View solution in original post

speedramps
Super User
Super User

You can't use a measure in CALCULATE filter, it must be a boolean or table expressions

However, you can create a temporary varaible with VAR and RETURN like this

Please click Accept as Solution and the thumbs up button, thank you!

 

Answer =
VAR yourchoice = SELECTEDVALUE(yourtable[yourcolumn])
RETURN
CALCULATE(
SUM(yourtable[yourvalue],
yourtable[yourcolumn]) =  yourchoice 
)



View solution in original post

3 REPLIES 3
speedramps
Super User
Super User

You can't use a measure in CALCULATE filter, it must be a boolean or table expressions

However, you can create a temporary varaible with VAR and RETURN like this

Please click Accept as Solution and the thumbs up button, thank you!

 

Answer =
VAR yourchoice = SELECTEDVALUE(yourtable[yourcolumn])
RETURN
CALCULATE(
SUM(yourtable[yourvalue],
yourtable[yourcolumn]) =  yourchoice 
)



rpinxt
Impactful Individual
Impactful Individual

Yes a variable would also work I guess.

Thanks for this additional solution @speedramps 🙂

 

rpinxt
Impactful Individual
Impactful Individual

Ok...nevermind turns out that I cannot use the measure but I can use the logic that I created measure CG_Sel with....

 

This worked :

rpinxt_0-1698749265866.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.