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

Plot line chart of current month by day vs average of last N months by day

Sample.png

 

Trying to plot a chart like show above with running count of participation. Line chart showing participation at days before and after due date with a comparison to rolling average of same days of last 3 months.

 

Fields in the data model,

  • DueDate
  • ParticipationDate
  • ReportingMonth
  • UserID

 

I am trying to replicate following table with DAX where ParticipationDate is +-5 from DueDate.

 

 Month-5d-4d-3d-2d-1dDue+1d+2d+3d+4d+5d
Jan'2020%22%25%28%35%50%80%90%95%95%96%
Feb'200%20%30%45%50%70%80%95%96%96%96%
Mar'2020%22%25%28%35%70%80%90%92%94%96%
            
Avearge13%21%27%34%40%63%80%92%94%95%96%
Apr'2020%30%40%50%65%85%     
2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Is the last table a fact table in your model or the result you want to get?

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

It is the result I am trying to get.

 

Here is the DAX I have gotten so far, for cumulative participation during current month. However, it does not work well if previous months are selected.

 

Participation % =
DIVIDE (
    CALCULATE (
        COUNTROWS ( MyTable ),
        FILTER (
            ALLSELECTED ( MyTable ),
            MyTable[ParticipationDate] <= LASTDATE ( MyTable[ParticipationDate] )
        ),
        MyTable[TimeReportStatus] = "Complete",
        ALLSELECTED ( MyTable[ReportName] ),
        DATESINPERIOD (
            'MyTable'[ParticipationDate],
            LASTDATE ( MyTable[ParticipationDate] ),
            -30,
            DAY
        )
    ),
    CALCULATE (
        COUNTA ( 'MyTable'[Login] ),
        ALLSELECTED ( 'MyTable'[ReportMonth], MyTable[ParticipationDate] )
    )

 

Sample Data:

ReportMonthReportStartDateReportEndDateReportDueDateLoginParticipationDate
Apr-204/1/20204/30/20205/1/2020Arya4/30/2020
Mar-203/1/20203/31/20204/1/2020John3/30/2020
Mar-203/1/20203/31/20204/1/2020Theon3/30/2020
Apr-204/1/20204/30/20205/1/2020Bran4/27/2020
Apr-204/1/20204/30/20205/1/2020Tywin4/28/2020
Mar-203/1/20203/31/20204/1/2020Arya3/31/2020
Mar-203/1/20203/31/20204/1/2020Bran3/24/2020
Mar-203/1/20203/31/20204/1/2020Sansa3/26/2020
Mar-203/1/20203/31/20204/1/2020Jaime4/2/2020
Mar-203/1/20203/31/20204/1/2020Tyrion3/31/2020

 

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.