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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jvelling
Frequent Visitor

Measure does not add up in matrix visual

Hi there,

 

I would like to calculate the total amount of contract hours per filtered time period. The following table is connected to an employee table, which in turn, is connected to other tables. 

 

jvelling_0-1661877632019.png

I have created a calculated column that computes the contract hours per day (ContractUrenPerDag). Furthermore, I have created the following measure that should compute the contract hours per filtered time period:

 

ContractHours = 

CALCULATE(
    SUM(Contracten[ContractUrenPerDag]),
    FILTER(
        Contracten,
        Contracten[StartDatum] <= FIRSTDATE(Kalender[Datum])
        && Contracten[EindDatum] >= LASTDATE(Kalender[Datum])
    )
)

 

However, when visualizing the results in a matrix table, the ContractHours measure total does not add up correctly. Besides, in week 5 it computes a blank value. 

jvelling_1-1661877895732.png

The date table is not connected to the contract hours table.  

 

Does anyone have a sollution for this problem? 

 

Thanks in advance,

Jaap

1 ACCEPTED SOLUTION
HoangHugo
Solution Specialist
Solution Specialist

Hi, to sum up value within rows, try this one

ContractHours = 
SUMX(SUMMARIZE (Datum column),
CALCULATE(
    SUM(Contracten[ContractUrenPerDag]),
    FILTER(
        Contracten,
        Contracten[StartDatum] <= FIRSTDATE(Kalender[Datum])
        && Contracten[EindDatum] >= LASTDATE(Kalender[Datum])
    )
))

View solution in original post

2 REPLIES 2
jvelling
Frequent Visitor

Thanks a lot @HoangHugo !!

HoangHugo
Solution Specialist
Solution Specialist

Hi, to sum up value within rows, try this one

ContractHours = 
SUMX(SUMMARIZE (Datum column),
CALCULATE(
    SUM(Contracten[ContractUrenPerDag]),
    FILTER(
        Contracten,
        Contracten[StartDatum] <= FIRSTDATE(Kalender[Datum])
        && Contracten[EindDatum] >= LASTDATE(Kalender[Datum])
    )
))

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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