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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

PowerBI use of periods

Dear all,

 

I am a newbie in PowerBI and stuck on a challenge. 

 

I have two datasets about demand and capacity. 

Capacity Dataset has the teams, a period (StartDate, EndDate) and the number of people(FTE) we have during that period.

The Demand Dataset has the Activity, a period for implementation(StartDate, EndDate), the team needed and number of people(FTE) needed from the team.

 

fulyaa_0-1609848766590.png

 

fulyaa_1-1609848818865.png

 

I would like to create reports on these datasets 

  • how many people we have each month from each team
  • the demand requirements per month per team
  • if the capacity is enough to meet the demand per month

I appreciate your help to solve this.

1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, you can do some steps as follows.

  1. Create a calculated column in “Demand” table.

 

Resource Team =

LOOKUPVALUE (

    'Activity'[Resource Team],

    Activity[Resource Type], [Resourcetype]

)

 

2. Create two calculated tables.

 

Question 1 =

VAR x1 =

    GENERATE (

        GENERATESERIES ( 1, 12 ),

        VAR inc = [Value] RETURN ROW ( "date", DATE ( 2021, inc, 1 ) )

    )

RETURN

    FILTER (

        CROSSJOIN ( 'Activity', x1 ),

        [date] >= [StartDate]

            && [date] <= [EndDate]

    )




Question 2 =

VAR x1 =

    GENERATE (

        GENERATESERIES ( 1, 12 ),

        VAR inc = [Value] RETURN ROW ( "date", DATE ( 2021, inc, 1 ) )

    )

RETURN

    FILTER (

        CROSSJOIN ( 'Demand', x1 ),

        [date] >= [StartDate]

            && [date] <= [EndDate]

    )

 

3. Create a measure.

 

Measure =

var x1 =

SUMX (

    FILTER (

        ALL ( 'Question 1' ),

        [date] = SELECTEDVALUE ( 'Question 1'[date] )

            && [Resource Team] = SELECTEDVALUE ( 'Question 1'[Resource Team] )

    ),

    [FTE]

)

var x2 =

COUNTX (

    FILTER (

        ALL ( 'Question 2' ),

        [date] = SELECTEDVALUE ( 'Question 2'[date] )

            && [Resource Team] = SELECTEDVALUE ( 'Question 2'[Resource Team] )

    ),

    [Demand Title]

)

return

IF(x1>=x2,"Yes","No")


4. Create some matrices.

v-yuaj-msft_0-1610010893142.png

 

v-yuaj-msft_1-1610010893152.png

v-yuaj-msft_0-1610010971079.png

 

Result:

v-yuaj-msft_1-1610010995763.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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-yuaj-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, you can do some steps as follows.

  1. Create a calculated column in “Demand” table.

 

Resource Team =

LOOKUPVALUE (

    'Activity'[Resource Team],

    Activity[Resource Type], [Resourcetype]

)

 

2. Create two calculated tables.

 

Question 1 =

VAR x1 =

    GENERATE (

        GENERATESERIES ( 1, 12 ),

        VAR inc = [Value] RETURN ROW ( "date", DATE ( 2021, inc, 1 ) )

    )

RETURN

    FILTER (

        CROSSJOIN ( 'Activity', x1 ),

        [date] >= [StartDate]

            && [date] <= [EndDate]

    )




Question 2 =

VAR x1 =

    GENERATE (

        GENERATESERIES ( 1, 12 ),

        VAR inc = [Value] RETURN ROW ( "date", DATE ( 2021, inc, 1 ) )

    )

RETURN

    FILTER (

        CROSSJOIN ( 'Demand', x1 ),

        [date] >= [StartDate]

            && [date] <= [EndDate]

    )

 

3. Create a measure.

 

Measure =

var x1 =

SUMX (

    FILTER (

        ALL ( 'Question 1' ),

        [date] = SELECTEDVALUE ( 'Question 1'[date] )

            && [Resource Team] = SELECTEDVALUE ( 'Question 1'[Resource Team] )

    ),

    [FTE]

)

var x2 =

COUNTX (

    FILTER (

        ALL ( 'Question 2' ),

        [date] = SELECTEDVALUE ( 'Question 2'[date] )

            && [Resource Team] = SELECTEDVALUE ( 'Question 2'[Resource Team] )

    ),

    [Demand Title]

)

return

IF(x1>=x2,"Yes","No")


4. Create some matrices.

v-yuaj-msft_0-1610010893142.png

 

v-yuaj-msft_1-1610010893152.png

v-yuaj-msft_0-1610010971079.png

 

Result:

v-yuaj-msft_1-1610010995763.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

amitchandak
Super User
Super User

@Anonymous ,

See if the HR blog can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

 

Both tables need to be joined twice with date table

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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