Forum Discussion

GunnZ's avatar
GunnZ
Regular Visitor
3 years ago
Solved

Measure not working with calculated column code due to "no single values"

Hi, I would like to know how i have to adapt my code for a measure that is working for a calculated column. There are two tables, one date table and one value table. The value table includes 4 colu...
  • v-zhangti's avatar
    3 years ago

    Hi, GunnZ 


    Sample data:

    You can try the following formula.

    Measure:

    Workload (h) test = 
    IF (
        WEEKDAY ( SELECTEDVALUE ( 'Date'[Date] ), 2 ) < 6,
        CALCULATE (
            SUM ( 'Monitoring Demand Input'[Workload (h) per day] ),
            FILTER (
                ALL ( 'Monitoring Demand Input' ),
                'Monitoring Demand Input'[Start Date] <= SELECTEDVALUE ( 'Date'[Date] )
                    && 'Monitoring Demand Input'[End Date] >= SELECTEDVALUE ( 'Date'[Date] )
            )
        ),
        0
    )

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.