The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
Due to performance issues I'm trying to use a measure instead of a calculated column. Now the column 'TotaalFout' is calculated in M (but maybe is in DAX better?) with the following logic: = Table.AddColumn(Table, "TotaalFout", each if [te_groot_bbp] = 1 then 1 else if [te_groot_pakket] = 1 then 1 else if [te_zwaar_bbp] = 1 then 1 else if [te_zwaar_pakket] = 1 then 1 else 0)
There is an exception that if it's te_groot (too big) AND te_zwaar (too heavy) it still calculates 1 beacause it's subject which the errors is about, is still one. This results in the follwing column:
The next step, why I find it hard to find a measure is that I use the sumfunction in the visual The collected data is dependend of dates. And I selected sum te_groot, te_zwaar and TotaalFout (etc..).
Does anyone has suggestions which kind of measure I could use?
Solved! Go to Solution.
Hi @lisannegesch ,
According the formula: = Table.AddColumn(Table, "TotaalFout", each if [te_groot_bbp] = 1 then 1 else if [te_groot_pakket] = 1 then 1 else if [te_zwaar_bbp] = 1 then 1 else if [te_zwaar_pakket] = 1 then 1 else 0)
Please have a try.
Create a measure:
TotaalFout =
IF (
MAX ( table[te_groot_bbp] ) = 1
|| MAX ( table[te_groot_pakket] ) = 1
|| MAX ( table[te_zwaar_bbp] ) = 1
|| MAX ( table[te_zwaar_pakket] ) = 1,
1,
0
)
If I have misunderstood your meaning, please provide more details with desired output and pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lisannegesch ,
According the formula: = Table.AddColumn(Table, "TotaalFout", each if [te_groot_bbp] = 1 then 1 else if [te_groot_pakket] = 1 then 1 else if [te_zwaar_bbp] = 1 then 1 else if [te_zwaar_pakket] = 1 then 1 else 0)
Please have a try.
Create a measure:
TotaalFout =
IF (
MAX ( table[te_groot_bbp] ) = 1
|| MAX ( table[te_groot_pakket] ) = 1
|| MAX ( table[te_zwaar_bbp] ) = 1
|| MAX ( table[te_zwaar_pakket] ) = 1,
1,
0
)
If I have misunderstood your meaning, please provide more details with desired output and pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I don't understand what it is you are trying to achieve. In your final table, what values do you want in the TotaalFout column?
Please share your data/file - at least a subset of data so we don't have to recreate the whole lot.
Regards
Phil
Proud to be a Super User!