Forum Discussion

KasperJ90's avatar
KasperJ90
Helper III
3 years ago
Solved

Calculated column from table with multiple ranges

Hi,   Need your help to add a calculated column based on each category. I have table 1 showing my categories and ranges and then table 2 with the "operation number" to use to sum all minutes within...
  • OzkanDhont's avatar
    3 years ago

    Hi KasperJ90 !

     

    Do you need it to be a calculated column?

    I've created something similar in the past but as a measure which will save up on your data model.

     

    Measure = 
    CALCULATE(
        SUM('Table (2)'[No.Minutes]),
        FILTER(
            'Table (2)',
                COUNTROWS(
                    FILTER(
                        'Table (1)',
                        'Table (2)'[Operations] > 'Table (1)'[Min] &&
                        'Table (2)'[Operations] <= 'Table (1)'[Max]
                    )
                )
             )
    )

    You can download the pbix file for better understanding: 

    https://filetransfer.io/data-package/ltw0G1YS#link

     

    Hope it helped!

     

    Kind regards,

    OD