Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

line graph for 3 months

hiii in my report i have a slicer based on its selection my data will change in all the 3 graphs but now i need a line showing past 2 and current month graph for my rawsla%,m.sla% and count of cal...
  • v-lili6-msft's avatar
    6 years ago

    hi  Anonymous 

    First, to create a dim date table, you should do it as below:

    https://radacad.com/do-you-need-a-date-dimension

     

    Calendar = ADDCOLUMNS( CALENDARAUTO(),   
        "Year", YEAR ( [Date] ),
        "Month", MONTH ( [Date] ),
        "MonthName", FORMAT ( [Date], "MMMM" )
    )
    

    then 'Query1'[Call Closed] column is a datetime column, so please add two column

    Call Closed Date = DATE(YEAR(Query1[Call Closed]),MONTH(Query1[Call Closed]),DAY(Query1[Call Closed]))
    Call Closed Month = MONTH(Query1[Call Closed])

    By the way, in this case, create relationship by [Call Closed Date] column instead of [Call Closed] column

     

     

    Now create measure as below to get your requirement:

    past 2 and current month RAW COUNT = 
    CALCULATE (
        [RAW COUNT],
        DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), -3, MONTH )
    )

    result:

     

    and here is sample pbix file, please try it.

     

    Regards,

    Lin