Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello i need a create a DAX to use in a card but i have this error
With the forumula i need to calculate the KPI PMP and i've create a new measure as is:
Where wrong? Thanks
Solved! Go to Solution.
PMP1 =
VAR var1 = CALCULATE([Machine Minutes], DimMachineStatus[MachineStatusId] = 16)
VAR var2 = CALCULATE([Machine Minutes], DimMachineStatus[MachineStatusId] IN {3,4,16})
VAR var3 = DIVIDE(var1, var2)
RETURN
var3 //but as you have an error check var1 and var1 return without errors.
OK, then yes. That's the problem.
If a column contains text, then DAX cannot compare it to an integer.
You must compare text to text or integers with integers.
You should be able to resolve this by changing the integers to strings within your measure, as follows.
PMP1 =
DIVIDE(
CALCULATE(
[Machine Minutes],
DimMachineStatus[MachineStatusId] = "16"
),
CALCULATE(
[Machine Minutes],
DimMachineStatus[MachineStatusId] IN {"3", "4" , "16"}
)
)
Regards,
Nathan
PMP1 =
VAR var1 = CALCULATE([Machine Minutes], DimMachineStatus[MachineStatusId] = 16)
VAR var2 = CALCULATE([Machine Minutes], DimMachineStatus[MachineStatusId] IN {3,4,16})
VAR var3 = DIVIDE(var1, var2)
RETURN
var3 //but as you have an error check var1 and var1 return without errors.
Hello and thanks for reply.
I try to divide the forumla and also use your proposal but have error.
If i use
Retourn this error
For more info:
Machine Minutes is the name of column in table "Measure" and is a number value
MachineStatusId is a text type of table DimMachineStatus
I need calculate this:
Need to extract from colum "Machine Minutes" the value of filtre 16 on MachineStatusID (VALUE 1)
Then divide VALUE 1 with the sum of value MachineStatusID 16, 3,4
Thanks
To troubleshoot,
1) Try separating each CALCULATE into its own separate measure to isolate where the error is.
2) If the error still occurs in each separate measure, remove the DimMachineStatus condition line to see if it still throws the error.
Are you able to 100% verify the data type of DimMachineStatus[MachineStatusId]?
If it happens to be data type TEXT, that would cause it since your measure is evaluating INTEGERS. (16 & {3,4,16})
Regards,
Nathan
Hello and thanks for reply. Yes DimMachineStatus[MachineStatusId] is a TEXT type...
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |