Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi @pagarc1
as you use a measure the DAX cannot understand what exactly cell of Department column you want to use for comparing.
So try to use SELECTEDVALUE() if you are trying to compare value in each rows, like
Order Type = if(SELECTEDVALUE('DIA SALES DATA'[Department])="24HRTS","DTP Nonrevenue",IF(SELECTEDVALUE('DIA SALES DATA'[Department])="Distributor","Distributor","DTP Revenue"))
or better use SWITCH() statement
SWITCH(
SELECTEDVALUE('DIA SALES DATA'[Department]),
"24HRTS","DTP Nonrevenue",
"Distributor","Distributor",
"DTP Revenue"
)
Hi @pagarc1 ,
In measure you can not refer column directly.
Your dax will work for calculated column not for measure.
Incase you want to do the calculation using measure add 'min'/'max'/Selectevalue before column name
Order Type = if(max('DIA SALES DATA'[Department])="24HRTS","DTP Nonrevenue",IF(max('DIA SALES DATA'[Department])="Distributor","Distributor","DTP Revenue"))
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
You can add only columns as slicer.
Create calculated column as below
Order Type = if('DIA SALES DATA'[Department]="24HRTS","DTP Nonrevenue",IF('DIA SALES DATA'[Department]="Distributor","Distributor","DTP Revenue"))
Note:
Measures are used for aggrigation and dynamic calculations.
Measure can be used as visual level filters but measures can be used in slicers.
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
I want to do something like this. I want to add it on a slicer although the previous formula worked. I couldn't add the field into a slicer.
Hi @pagarc1 ,
While I cannot definitively answer why you are getting this without seeing your Data Model, in my experience when you get this type of error it is generally down to the data model relationships and setup.
A good resource on this:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
46 | |
39 | |
19 | |
19 |