Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

*UPDATED* still need help creating the time intelligence visual I have in mind

Hi there,   I am working with a customer complaint database for a municipal water provider. I have a direct link to an SQL server/database which automatically populates my dashboard visuals with ne...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    Thanks audreygerred  for the quick reply. I have some other ideas for you to consider:
    I don't have access to open your pbix file, I created some test data.

    We can create measures.

    this_week = CALCULATE(SUM('Table'[Number of calls]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=TODAY() && 'Table'[Date]>=TODAY()-7))
    LY = 
    var _end_date=DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
    var _start_date=_end_date-7
    return CALCULATE(SUM('Table'[Number of calls]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=_end_date && 'Table'[Date]>=_start_date))
    LLY = 
    var _end_date=DATE(YEAR(TODAY())-2,MONTH(TODAY()),DAY(TODAY()))
    var _start_date=_end_date-7
    return CALCULATE(SUM('Table'[Number of calls]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=_end_date && 'Table'[Date]>=_start_date))
    LLLY = 
    var _end_date=DATE(YEAR(TODAY())-3,MONTH(TODAY()),DAY(TODAY()))
    var _start_date=_end_date-7
    return CALCULATE(SUM('Table'[Number of calls]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=_end_date && 'Table'[Date]>=_start_date))
    LLLLY = 
    var _end_date=DATE(YEAR(TODAY())-4,MONTH(TODAY()),DAY(TODAY()))
    var _start_date=_end_date-7
    return CALCULATE(SUM('Table'[Number of calls]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=_end_date && 'Table'[Date]>=_start_date))
    LLLLLY = 
    var _end_date=DATE(YEAR(TODAY())-5,MONTH(TODAY()),DAY(TODAY()))
    var _start_date=_end_date-7
    return CALCULATE(SUM('Table'[Number of calls]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=_end_date && 'Table'[Date]>=_start_date))
    Avg = DIVIDE([LY]+[LLY]+[LLLY]+[LLLLY]+[LLLLLY],5)

    Then the result is as follows.

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

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