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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Ronald123
Resolver III
Resolver III

Total workingdays by subgroup

 

Hello,

 

Can anyone help me with a measure for the total workingsdays by subgroup.

In the middle matrix the measure workingsdays shows the right number of working by contno.

 

In the fist matrix i need the totals of all workingsdays from the contract in the subgroup WCKLEP.

 

 

 

 

Screen Shot 10-19-17 at 03.31 PM 001.PNG 

 

Screen Shot 10-19-17 at 03.34 PM 001.PNG

1 ACCEPTED SOLUTION


@Ronald123 wrote:

@Eric_Zhang

 

Hello Eric,

 

Thank you for the measure, the calculation in perfect.

 

I have only a performance problem, i have a sql connection in the direct query mode, it's verry slow.

The table history have 400K lines, and this is with a filter of the years 2016 / 2017.

 

The date / history table have not a relationship at this moment.

 

Is there someting to do for a faster report?

 

 

Beste Regards,

 

Ronald


@Ronald123

Using complicated measure in DirectQuery mode affects the performance, in your case, I'd suggest you generate workingdays in the table2 of your original post in SQL query.

View solution in original post

3 REPLIES 3
Eric_Zhang
Employee
Employee

@Ronald123

You need to create a measure as below. See more details in the attached pbix file.

workingdaysTotal = 
VAR summrizedTBL =
    SUMMARIZE (
        History,
        History[CONTNO],
        History[SDATE],
        History[EDATE],
        "workingdays", [Workingdays]
    )
RETURN
    IF (
        ISFILTERED ( History[CONTNO] ),
        [Workingdays],
        SUMX ( summrizedTBL, [workingdays] )
    )

Capture.PNG

 

@Eric_Zhang

 

Hello Eric,

 

Thank you for the measure, the calculation in perfect.

 

I have only a performance problem, i have a sql connection in the direct query mode, it's verry slow.

The table history have 400K lines, and this is with a filter of the years 2016 / 2017.

 

The date / history table have not a relationship at this moment.

 

Is there someting to do for a faster report?

 

 

Beste Regards,

 

Ronald


@Ronald123 wrote:

@Eric_Zhang

 

Hello Eric,

 

Thank you for the measure, the calculation in perfect.

 

I have only a performance problem, i have a sql connection in the direct query mode, it's verry slow.

The table history have 400K lines, and this is with a filter of the years 2016 / 2017.

 

The date / history table have not a relationship at this moment.

 

Is there someting to do for a faster report?

 

 

Beste Regards,

 

Ronald


@Ronald123

Using complicated measure in DirectQuery mode affects the performance, in your case, I'd suggest you generate workingdays in the table2 of your original post in SQL query.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.