# Tips & Troubleshooting

## Power BI Best Practices

### Recommended Data Model

Create these relationships when building your Power BI model:

| From                                    | To                                     | Type               |
| --------------------------------------- | -------------------------------------- | ------------------ |
| `v_Conversation.contactId`              | `v_Contact.id`                         | Many-to-One        |
| `v_Conversation.assignedToAgentId`      | `v_Agent.id`                           | Many-to-One        |
| `v_Conversation.teamId`                 | `v_Team.id`                            | Many-to-One        |
| `v_ConversationTimeline.conversationId` | `v_Conversation.id`                    | Many-to-One        |
| `v_ConversationTimeline.agentId`        | `v_Agent.id`                           | Many-to-One        |
| `v_ContactAddress.contactId`            | `v_Contact.id`                         | Many-to-One        |
| `v_Tag.parentTagId`                     | `v_Tag.id`                             | Many-to-One (self) |
| `v_CustomFieldDefinition.key`           | JSON key in `conversationCustomFields` | Logical join       |
| `v_CustomFieldDefinition.key`           | JSON key in `contactCustomFields`      | Logical join       |
| `v_VoiceCalls.conversationId`           | `v_Conversation.id`                    | One-to-One         |

### Performance Tips

1. **Use DirectQuery** for real-time data (recommended)
2. **Filter by date** - Always include date filters in your reports
3. **Limit text columns** - Avoid displaying `text` columns in large tables
4. **Use aggregations** - Use pre-aggregated views (`ByQueue_Daily`, `ByQueue_AllTime`) for dashboards

### Useful DAX Measures

```dax
// Average First Response Time (minutes)
Avg First Response =
AVERAGE(v_Conversation[minutesToFirstResponse])

// Average Resolution Time (hours)
Avg Resolution Time =
DIVIDE(
    AVERAGE(v_Conversation[totalResolutionTimeInMinutes]),
    60,
    0
)

// Conversations This Month
Conversations This Month =
CALCULATE(
    COUNTROWS(v_Conversation),
    MONTH(v_Conversation[started]) = MONTH(TODAY()),
    YEAR(v_Conversation[started]) = YEAR(TODAY())
)

// Abandonment Rate
Abandonment Rate =
DIVIDE(
    SUM(v_VoiceCalls[IsAbandoned]),
    COUNTROWS(v_VoiceCalls),
    0
)

// SLA Breach Rate
SLA Breach Rate =
DIVIDE(
    COUNTROWS(FILTER(v_Conversation, v_Conversation[currentSlaPolicyStatusName] = "Breached")),
    COUNTROWS(v_Conversation),
    0
)

// Messages Per Conversation
Messages Per Conversation =
DIVIDE(
    COUNTROWS(v_ConversationTimeline),
    COUNTROWS(v_Conversation),
    0
)

// Alia Resolution Rate (% resolved by AI without human transfer)
Alia Resolution Rate =
VAR AliaTotal = COUNTROWS(FILTER(v_Conversation, v_Conversation[initialStatusName] = "Alia"))
VAR ResolvedByAlia = COUNTROWS(FILTER(v_Conversation,
    v_Conversation[initialStatusName] = "Alia"
    && ISBLANK(v_Conversation[transferredToHumanAt])
    && v_Conversation[statusName] IN {"Archived", "Closed"}
))
RETURN DIVIDE(ResolvedByAlia, AliaTotal, 0)

// Alia Transfer Rate (% transferred to human)
Alia Transfer Rate =
DIVIDE(
    COUNTROWS(FILTER(v_Conversation,
        v_Conversation[initialStatusName] = "Alia"
        && NOT(ISBLANK(v_Conversation[transferredToHumanAt]))
    )),
    COUNTROWS(FILTER(v_Conversation, v_Conversation[initialStatusName] = "Alia")),
    0
)
```

***

## Troubleshooting

### "Login failed" or "Access denied"

**Cause:** Your Microsoft account is not in the access group.

**Solution:**

1. Verify you're using the correct Microsoft account
2. Contact your administrator to confirm you've been added to the reader group
3. Wait 5-10 minutes after being added (permissions propagate)

### No data appears

**Cause:** Selecting wrong views or data not yet synced.

**Solution:**

1. Make sure you're selecting views with your tenant name (e.g., `v_Conversation_YourCompany`)
2. Data syncs hourly - very recent data may not be available yet
3. Check that your date filters aren't excluding all data

### Slow queries or timeouts

**Cause:** Queries scanning too much data.

**Solution:**

1. Add date filters to limit the data range
2. Use DirectQuery mode instead of Import
3. Avoid loading the full `text` column from ConversationTimeline
4. Use pre-aggregated views for dashboards

### "Invalid column name" errors

**Cause:** Column doesn't exist or was renamed.

**Solution:**

1. Refresh your Power BI data source schema
2. Check this documentation for correct column names
3. Contact support if the issue persists

### Data looks incorrect or outdated

**Cause:** Caching or sync delays.

**Solution:**

1. Data syncs hourly - wait up to 1 hour for recent changes
2. In Power BI, click "Refresh" to get latest data
3. Clear your browser cache if using Power BI Service

### Voice calls data missing for certain dates

**Cause:** Schema migration between old and new data formats.

**Solution:** The VoiceCalls views automatically handle both old (JSON-based) and new (flattened column) data formats. If you see missing data:

1. Verify date filters aren't excluding the date range
2. Check if the CallDate filter is set correctly in Power BI
3. Data from before January 2026 uses the legacy JSON format and is still accessible

***

## Getting Help

If you need assistance:

1. Contact your SuperAgent administrator
2. Review this documentation for examples
3. Reach out to SuperAgent support

{% hint style="info" %}
**Tip:** When reporting issues, include the exact error message and the query or view you were using.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://atender-labs.gitbook.io/atender-labs-docs/analytics/tips.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
