Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Average headcount basis Month, Location, Entity, Status & Type

Dear Guru/s,

 

I am a novice in Power Bi desktop - learning the ways. 

Have been trying to build a report based on slicer selection of Month / Location/ Status/ & Type.

Able to create MTD avg and %ages with measures, 

but slicers do not work in accordance to moving avg YTD or Total YTD exits - PBIX link attached for ref. 

Sample file 

Please suggest how to go about it  - single table mentioned below  :

DateZoneEntity_DescIdsTypeStatusUnitStatusExitsDateKeyYearNumberYearMonthNumberMonth
Apr-19NCR-1Discovery NetworkXX01EmployeeFull TimeLOSOpening 201904012020FY 20201April
Apr-19NCR-1WalmartXX02TemporaryPart TimeHOUOpening 201904012020FY 20201April
Apr-19NCR-1Holiday InnXX03ContractualFull TimeHOUOpeningInactive201904012020FY 20201April
May-19NCR-1Discovery NetworkXX01EmployeeFull TimeLOSOpening 201905012020FY 20202May
May-19NCR-1WalmartXX02TemporaryPart TimeHOUOpeningInactive201905012020FY 20202May
May-19NCR-1Holiday InnXX04EmployeeNursingTEXNew joiner 201905012020FY 20202May
Jun-19NCR-1Discovery NetworkXX01EmployeeFull TimeLOSOpening 201906012020FY 20203June
Jun-19NCR-1WalmartXX04TemporaryPart TimeTEXOpeningInactive201906012020FY 20203June
Jun-19NCR-1Holiday InnXX05ContractualFull TimeHOUNew joinerInactive201906012020FY 20203June
Jul-19NCR-1Discovery NetworkXX01EmployeeNursingLOSOpening 201907012020FY 20204July
Jul-19NCR-1WalmartXX06ContractualFull TimeTEXNew joiner 201907012020FY 20204July

2 Replies

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

     

    Try using the below pattern to calculate YTD

    YTD Exits = 
    CALCULATE(
        [Exits],
        DATESYTD( Sheet1[Date].[Date] )
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Mariusz,

       

      Thanks for the code.

      The output received basis the code is of Month on months Exits ( e.g. April -10, May-15 ...)and not rolling YTD exits (e.g. April - 10, May - (10+15 = 25), as required here.

       

      Please advise.

      Regards,

      Pratz