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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
GunnZ
Regular Visitor

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 columns of interest:

Project name, Workload (h) per day, Start Date, End date

The calculated column in the date table had to following code to sum up the workload on each day:

Workload (h) test = CALCULATE(
    SUM('Monitoring Demand Input'[Workload (h) per day]),
    FILTER(
        'Monitoring Demand Input',
        'Monitoring Demand Input'[Start Date] <= 'Date'[Date]
        &&
        'Monitoring Demand Input'[End Date]>= 'Date'[Date]
    )
)

 

However, this code doesn't work with a measure as the column Date doesn't contain a single/unique value:

GunnZ_1-1667227896522.png

I need the measure to allow the filtering on the column Project name, which is lost by the calculated column.

Thank you for your help and time!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @GunnZ 


Sample data:

vzhangti_0-1667280344962.png

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
)

vzhangti_1-1667280421238.png

 

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.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @GunnZ 


Sample data:

vzhangti_0-1667280344962.png

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
)

vzhangti_1-1667280421238.png

 

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.

Hi Charlotte,

 

Thank you for the help and showing me SELECTEDVALUE.

However, the filtering is still lost. The sample data has an additonal column called "type".  

A slicer doesn't work and if I add the "type" as a legend, it simply duplicates the data:

GunnZ_0-1667378074160.png

And a follow-up question: to sum up the workload per week, I would create a second measure to sum up the first correct?

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.