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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
lisannegesch
Frequent Visitor

Make a measure instead of a calculated column

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:

 

lisannegesch_0-1667389389314.png

 

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..). 

 

lisannegesch_1-1667389709243.png

 

Does anyone has suggestions which kind of measure I could use? 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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.

 

PhilipTreacy
Super User
Super User

Hi @lisannegesch 

 

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors