Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Month on Month

Hi,

 

I need help to create Day on Day, Month on Month differnce percebtage.

 

I have column with count of incident number and I've removed duplicates by creating a new measure.

And I have a entry created date coulmn as well 

Based on this I need to create a DoD and MoM percentage difference.

Kindly help

Thank you

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  Anonymous ,

    For Week, you can use the following dax:

    WOW_current =
    CALCULATE(
        DISTINCTCOUNT('MOM'[IncidentID]),FILTER(ALL('MOM'),'MOM'[Week]=MAX('MOM'[Week])))
    WOW_Last =
    IF(
        MAX('MOM'[Week]) =1 ,
        CALCULATE(
        DISTINCTCOUNT('MOM'[IncidentID]),FILTER(ALL('MOM'),'MOM'[Week]=
        WEEKNUM(
            DATE(YEAR(MAX('MOM'[EntryCreateDate]))-1,12,31),2))),
    CALCULATE(
        DISTINCTCOUNT('MOM'[IncidentID]),FILTER(ALL('MOM'),'MOM'[Week]=MAX('MOM'[Week])-1)))
    WOWValue =
    DIVIDE(
        [WOW_Last],[WOW_current])

     

    Best Regards,

    Liu Yang

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

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    I created some data:

     

    Here are the steps you can follow:

    1. Create measure.

    DOD:

    DOD_current =
    CALCULATE(    DISTINCTCOUNT('MOM'[IncidentID]),FILTER(ALL('MOM'),'MOM'[EntryCreateDate]=MAX('MOM'[EntryCreateDate])))
    DOD_last =
    CALCULATE(  DISTINCTCOUNT('MOM'[IncidentID]),FILTER(ALL('MOM'),'MOM'[EntryCreateDate]=MAX('MOM'[EntryCreateDate])-1))
    DODVALUE =
    DIVIDE(
        [DOD_last],[DOD_current])

    MOM:

    MOM_current =
    CALCULATE(
        DISTINCTCOUNT('MOM'[IncidentID]),
    PARALLELPERIOD(
        'MOM'[EntryCreateDate].[Date],-1,MONTH))
    MOM_last =
    CALCULATE(
        DISTINCTCOUNT('MOM'[IncidentID]),
    PARALLELPERIOD(
        'MOM'[EntryCreateDate].[Date],0,MONTH))
    MOMVALUE =
    DIVIDE(
        [MOM_current],[MOM_last])

    2. Result:

     

    Best Regards,

    Liu Yang

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous 

      Thank you for help and it worked.

      Can you help with week as well, is is the same as day ? 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    For Week, you can use the following dax:

    WOW_current =
    CALCULATE(
        DISTINCTCOUNT('MOM'[IncidentID]),FILTER(ALL('MOM'),'MOM'[Week]=MAX('MOM'[Week])))
    WOW_Last =
    IF(
        MAX('MOM'[Week]) =1 ,
        CALCULATE(
        DISTINCTCOUNT('MOM'[IncidentID]),FILTER(ALL('MOM'),'MOM'[Week]=
        WEEKNUM(
            DATE(YEAR(MAX('MOM'[EntryCreateDate]))-1,12,31),2))),
    CALCULATE(
        DISTINCTCOUNT('MOM'[IncidentID]),FILTER(ALL('MOM'),'MOM'[Week]=MAX('MOM'[Week])-1)))
    WOWValue =
    DIVIDE(
        [WOW_Last],[WOW_current])

     

    Best Regards,

    Liu Yang

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