The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
I have the followed measure
Selected Item =
VAR Selection = SELECTEDVALUE(Cost_Item,[Attribute],"All"
RETURN
SWITCH(
TRUE(),
Selection = "Salary", [Salary],
Selection = "Taxes",[Taxes],
Selection = "Commission",[Commision],
BLANK()
)
But i want to select more than one attribute and sum them:
I've tried
Selection IN ("Salary","Taxes"), [Taxes]+[Salary]
But that doesnt work
Any Help?
Thank you
Solved! Go to Solution.
Hi @keyway ,
Yes something similar to that.
Can you share a small sample of data and how you are calculating the taxes, and other measures?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @keyway ,
Looking at your expression I'm assuming that you have an attribute column with (Salary, Taxes and Comission) and some measures with Salary, Taxes and Comission correct?
If you just make the Salary + Taxes + Comissions using a slicer should give expected result since the calculation of each measure will only be made if you select the value.
If this is not expected result can you share a sample of you data and expected value please.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português
You mean something like this Selection = "Taxes",[Taxes]+0 ?
Hi @keyway ,
We use the dax similar to the following to capture the multiple values from slicer:
Selecetvalues = values(table[slicer])
Would you please inform us more detailed information( your sample data(by OneDrive for Business)) if possible? Then we will help you more correctly.
Please don't contain any Confidential Information or Real data in your reply or files.
Best Regards,
Dedmon Dai
Hi @keyway ,
Yes something similar to that.
Can you share a small sample of data and how you are calculating the taxes, and other measures?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi Miguel
Your assumptions are correct:
If i select more than one item using a slicer the result is always a blank value, if i select one single item from the slicer i get the correct value.
Hi @keyway ,
Try to add a +0 to the measure you have.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi
Yes, in fact that is the syntax i have on the code, i just missplaced the brakets on the message.
It shows a blank result
Thank you
Was this ever actually resolved? I've tried Selection IN {a, b, c} = a + b + c and it does not work.
I can only get my switch statement to work with single selection, but I need to be able to factor in for multiple selections and can't seem to find a solution if this is possible.
Hi @SH-4 ,
Can you please share some more detials on your requeriments?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português