Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Time intelligence measures

Hi all,

I'm hoping someone can help. I need to create some time intelligence measures.

 

I have a large data table (10,000+ rows) of information relating to customer support documents, and how often each document has been used in a support scenario. Rows include the customer name for each document, the RefNum for the support ticket that has resulted from each support scenario (RefNum does not contain unique numbers, because a customer support document might have been used in multiple different support scenarios. So each row in the table represents a single support scenario), the Full Name of the support analyst who handled the case, the timestamp 'DateActivityCreated' of when the case was generated, and the title of the support document. Example below:

 

TenantRefNumFull NameDateActivityCreatedDoc Title
Google9193141Jenny Jenson2/12/2019 14:18Google - Pin@store Error - Card could not be written or read
Alphabet9193142Jenny Jenson14/01/2020 14:16Alphabet - Application - Adobe products license issue
Apple9193144Jenny Jenson2/12/2019 14:18Apple - Password Reset - NPE
Google9193145Jenny Jenson2/12/2019 14:19Google - Postlink - Freezing in Parcel Value Field
IBM9193147Jimmy James2/12/2019 14:17IBM - Network (LAN) Account Unlock
IBM9193147Jimmy James2/12/2019 14:18IBM - Network (LAN) Account Unlock
IBM9193147Jimmy James2/12/2019 14:18IBM - Network (LAN) Account Unlock
IBM9193147Cameron Camson2/12/2019 14:16IBM - Network (LAN) Account Unlock
IBM9193147Jenny Jenson14/01/2020 14:16IBM - Network (LAN) Account Unlock
IBM9193147Jimmy James14/01/2020 14:16IBM - Network (LAN) Account Unlock
IBM9193147Jimmy James14/01/2020 14:16IBM - Network (LAN) Account Unlock
IBM9193147Jimmy James14/01/2020 14:16IBM - Network (LAN) Account Unlock
IBM9193147Jimmy James14/01/2020 14:16IBM - Network (LAN) Account Unlock
ICC9193151Cameron Camson2/12/2019 14:19ICC - eShip - Child Accounts
Alphabet9193152Cameron Camson2/12/2019 14:18Alphabet - JDE - Unable to save the report because the network drive is missing
Samsung9193154Jackie Jackson14/01/2020 14:16Samsung - New user request
Samsung9193154Jackie Jackson2/12/2019 14:18Samsung - New user request
Samsung9193154Jackie Jackson2/12/2019 14:18Samsung - New user request
Samsung9193154Jackie Jackson2/12/2019 14:18Samsung - New user request
Samsung9193154Jackie Jackson2/12/2019 14:18Samsung - New user request
Samsung9193154Jackie Jackson2/12/2019 14:18Samsung - New user request
Google9193168Jackie Jackson2/12/2019 14:22Google - NZTA TXN Error - 953 timed out waiting for response from CDI
Blackberry Limited9193172Jimmy James2/12/2019 14:21Blackberry Limited – Email – Outlook Issues (Generic)
Blackberry Limited9193172Jimmy James14/01/2020 14:16Blackberry Limited – Email – Outlook Issues (Generic)
Blackberry Limited9193172Jimmy James2/12/2019 14:21Blackberry Limited – Email – Outlook Issues (Generic)
Samsung9193174Jimmy James2/12/2019 14:21Samsung - Disable user request
ICC9193175Jimmy James2/12/2019 14:22ICC - eShip - Printer Issues (newly onboarded user)
Alphabet9193177Jenny Jenson2/12/2019 14:21Alphabet - Forcepoint - Email Releases
Alphabet9193177Jenny Jenson14/01/2020 14:16

Alphabet - Forcepoint - Email Releases

 

I'd like to be able to create a summary table, that shows a unique list of the support documents, the customer name for each document, and some measures. Here's an example (the columns in bold are the ones I need):

 

CustomerDocTitleCount Links (Last Month)Count Links (Last Month -2)% Change From (Last Month -2)Rank (Last Month)Rank (Last Month -2)Rank Change (From Last Month-2 to Last Month)
IBMIBM - Network (LAN) Account Unlock5425%12-1
AlphabetAlphabet - Application - Adobe products license issue10New2N/A2
SamsungSamsung - New user request15-80%21-1
Blackberry LimitedBlackberry Limited – Email – Outlook Issues (Generic)12-50%23-1
AlphabetAlphabet - Forcepoint - Email Releases110%24-2
GoogleGoogle - Pin@store Error - Card could not be written or read01-100%N/A4-4
AppleApple - Password Reset - NPE01-100%N/A4-4
GoogleGoogle - Postlink - Freezing in Parcel Value Field01-100%N/A4-4
ICCICC - eShip - Child Accounts01-100%N/A4-4
AlphabetAlphabet - JDE - Unable to save the report because the network drive is missing01-100%N/A4-4
GoogleGoogle - NZTA TXN Error - 953 timed out waiting for response from CDI01-100%N/A4-4
SamsungSamsung - Disable user request01-100%N/A4-4
ICCICC - eShip - Printer Issues (newly onboarded user)01-100%N/A4-4


And here's how the fields would be calculated:

1) Count Links (Last Month) = count of how many times each support document has been used (based on how many rows it appears in, in the month preceeding whatever month it is currently)
2) Count Links (Last Month -2) = count of how many times each support document has been used (based on how many rows it appears in, in the month BEFORE the month preceeding whatever month it is currently)
3) % Change From (Last Month -2) = This would be calculated as (#3-#2)/#2, except where #2 = 0, in which case the result should be "New"
4) Rank (Last Month) = for the top 20 support documents only, this will show a ranking based on #1
5) Rank (Last Month -2) = for the top 20 support documents only, this will show a ranking based on #1 (in the month BEFORE the month preceeding whatever month it is currently)
6) Rank Change (From Last Month-2 to Last Month) = the difference between #4 and #5

Hope that all makes sense. Any help would really be appreciated!

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. You may create a calculated table as follows. I used "Date(2020,1,1)" as the current date for testing. You may replace it with Now().

Summary = 
SUMMARIZE(
          'Table',
          'Table'[Tenant],
          'Table'[Doc Title],
          "Count Links (Last Month)",
          CALCULATE(
                   COUNTROWS('Table'),
                   FILTER(
                        'Table',
                        AND(
                            'Table'[DateActivityCreated]<=EOMONTH(DATE(2020,2,1),-1),
                            'Table'[DateActivityCreated]>=EOMONTH(DATE(2020,2,1),-2)+1
                        )
                   )
          ),
          "Count Links (Last Month -2)",
          CALCULATE(
                   COUNTROWS('Table'),
                   FILTER(
                        'Table',
                        AND(
                            'Table'[DateActivityCreated]<=EOMONTH(DATE(2020,2,1),-2),
                            'Table'[DateActivityCreated]>=EOMONTH(DATE(2020,2,1),-3)+1
                        )
                   )
          )

)

 

b1.png

 

Here are the measures.

% Change From (Last Month -2) = 
var _lastmonth2 = SUM(Summary[Count Links (Last Month -2)])
var _lastmonth = SUM(Summary[Count Links (Last Month)])
return
IF(
    _lastmonth2 <> 0,
    SUMX(
         Summary,
         (_lastmonth-Summary[Count Links (Last Month -2)])/Summary[Count Links (Last Month -2)]
    ),
    "New"
)

Rank (Last Month) = 
RANKX(
    ALLSELECTED(Summary),
    CALCULATE(SUM(Summary[Count Links (Last Month)])),
    ,
    DESC,
    Dense
)

Rank (Last Month -2) = 
RANKX(
      ALLSELECTED(Summary),
      CALCULATE(SUM(Summary[Count Links (Last Month -2)])),
      ,
      DESC,
      Dense
)

Rank Change (From Last Month-2 to Last Month) = [Rank (Last Month)]-[Rank (Last Month -2)]

 

Then you may go to the table level filter and configure both the values of Rank(Last Month) and Rank(Last Month - 2) with 'is less than or equal to 20'.

 

Result:

b2.png

 

Best Regards

Allan

 

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

 

View solution in original post

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

Anonymous
Not applicable

Apologies @v-alq-msft, I forgot to do that - thanks for following it up for me!

v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. You may create a calculated table as follows. I used "Date(2020,1,1)" as the current date for testing. You may replace it with Now().

Summary = 
SUMMARIZE(
          'Table',
          'Table'[Tenant],
          'Table'[Doc Title],
          "Count Links (Last Month)",
          CALCULATE(
                   COUNTROWS('Table'),
                   FILTER(
                        'Table',
                        AND(
                            'Table'[DateActivityCreated]<=EOMONTH(DATE(2020,2,1),-1),
                            'Table'[DateActivityCreated]>=EOMONTH(DATE(2020,2,1),-2)+1
                        )
                   )
          ),
          "Count Links (Last Month -2)",
          CALCULATE(
                   COUNTROWS('Table'),
                   FILTER(
                        'Table',
                        AND(
                            'Table'[DateActivityCreated]<=EOMONTH(DATE(2020,2,1),-2),
                            'Table'[DateActivityCreated]>=EOMONTH(DATE(2020,2,1),-3)+1
                        )
                   )
          )

)

 

b1.png

 

Here are the measures.

% Change From (Last Month -2) = 
var _lastmonth2 = SUM(Summary[Count Links (Last Month -2)])
var _lastmonth = SUM(Summary[Count Links (Last Month)])
return
IF(
    _lastmonth2 <> 0,
    SUMX(
         Summary,
         (_lastmonth-Summary[Count Links (Last Month -2)])/Summary[Count Links (Last Month -2)]
    ),
    "New"
)

Rank (Last Month) = 
RANKX(
    ALLSELECTED(Summary),
    CALCULATE(SUM(Summary[Count Links (Last Month)])),
    ,
    DESC,
    Dense
)

Rank (Last Month -2) = 
RANKX(
      ALLSELECTED(Summary),
      CALCULATE(SUM(Summary[Count Links (Last Month -2)])),
      ,
      DESC,
      Dense
)

Rank Change (From Last Month-2 to Last Month) = [Rank (Last Month)]-[Rank (Last Month -2)]

 

Then you may go to the table level filter and configure both the values of Rank(Last Month) and Rank(Last Month - 2) with 'is less than or equal to 20'.

 

Result:

b2.png

 

Best Regards

Allan

 

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

 

Anonymous
Not applicable

@v-alq-msft: Hi Allan, that's perfect 🙂 Thank you so much for the detailed response, I really appreciate it 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.