# ✨Filter Context

The xViz Performance Flow visual allows you to add descriptive notes to nodes, enhancing the storytelling around your data. These notes dynamically adjust based on the filter and slicer selections, providing contextually relevant insights.

{% embed url="<https://www.youtube.com/watch?v=XUGIcX06Z_8>" %}
Filter Context in xViz Performance Flow for Power BI
{% endembed %}

#### **Example:**

In January, Brandon’s low sales may be attributed to health issues and sick leave. A Data Analyst can add this note to Brandon's node. To analyze Brandon’s performance for the next coming month. The note is only displayed when January is selected in the Month slicer.

This is where the filter context will help. The filter context will ensure that notes are displayed only when the corresponding slicer selections are made, providing relevant and accurate insights based on the selected data.

### **Steps to configure Filter Context in the xViz Performance Flow visual:**

1. Create a Month Slicer in the report

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2F0AfwmE0UE0bGy42CCX7J%2F0.png?alt=media" alt=""><figcaption><p>Image 2: Month Slicer</p></figcaption></figure>

2. Next, navigate to the Performance Flow visual and click on Filter Context in the Analyze Pane located at the top of the menu pane

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2F3dcpC2jXjxTdtYpQiR5B%2F1.png?alt=media" alt=""><figcaption><p>Image 3: Top Menu - Analyze Pane</p></figcaption></figure>

3. Click on “Generate DAX” to generate a DAX query

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FLyAfB8TpTlg3Ucpf4lYb%2F2.png?alt=media" alt=""><figcaption><p>Image 4: Filter Context Settings</p></figcaption></figure>

4. We get the pop-up box to provide details of the columns used in the Slicers. The table name and column names.

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FlshvgkVnq8zHjo6iwahz%2F3.png?alt=media" alt="" width="386"><figcaption><p>Image 5: Filter Context Box to add Table Name</p></figcaption></figure>

5. Add the Table name and column name of the columns used in the Slicers of the report.
6. Click the Generate DAX button, and a new DAX measure will be generated. You can also add multiple slicers by clicking "Add New"

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FeMUbkejKYyypva6kJO95%2F4.png?alt=media" alt="" width="379"><figcaption><p>Image 6: Click on Generate DAX</p></figcaption></figure>

7. We get a DAX query that will return the value/(s) selected in the report slicers.
8. When a DAX measure is created, a copy button appears. Click it to copy the DAX measure.

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FXuX5iD6TqyHo81eXfscF%2F5.png?alt=media" alt=""><figcaption><p>Image 7: Click on the Copy Icon to copy the measure</p></figcaption></figure>

9. Create a new measure in the data model and paste the copied DAX query as its definition

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2F7tr2TZTMsaoa2uY0Lqhl%2F6.png?alt=media" alt=""><figcaption><p>Image 8: DAX measure</p></figcaption></figure>

10. Add the newly created measure data field of the xViz Performance Flow visual

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FcttUDmNykM2ifGdOVWNV%2F7.png?alt=media" alt=""><figcaption><p>Image 9: Filter Context option in Data Pane</p></figcaption></figure>

11. The visual will now have context about what values have been selected in the Slicers.
12. Referring to the example we considered in the Introduction:
    * In the Month slicer, select January
    * Hover on the node on which you would like to add the note
    * Click the ellipsis icon on the top of the node
    * Select "Add note”

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2Fjq8iaaS6cwcImSW6aGZN%2F8.png?alt=media" alt=""><figcaption><p>Image 10: Click on the Ellipse icon to add a note</p></figcaption></figure>

* Type the note on the person who had a low performance in January, note on the Salesperson – Brandon Harris had the lowest sales due to health issues.

Brandon's note will only appear when the Month slicer is set to January, as display in the GIF below

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2F9HgcARSGxKTOh5uaBT3q%2FUntitled%20Project.gif?alt=media&#x26;token=ceb04fbe-1802-482d-8f45-bfbbf16fd440" alt=""><figcaption><p>Image 11: Low Performance of the month</p></figcaption></figure>

* Now change the month to April and add the note for the highest sales performer – Mike Jones is the Highest Sales performer in all the regions in this month\
  With the Filter Context, this note is only specific to April.

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FJez6Q3pOoJWp0jJpK6A7%2F10.png?alt=media" alt=""><figcaption><p>Image 12: Highest Performer in April</p></figcaption></figure>

**Result:**

No notes will be displayed when different months are selected in the Slicer, other than January or April:

<figure><img src="https://382510089-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIuuIZWiXEx25eV75hmmJ%2Fuploads%2FjgvolSALkZ2g6fcBbguG%2F11.png?alt=media" alt=""><figcaption><p>Image 13: No notes when February is selected in Slicer</p></figcaption></figure>

Filter Context allows us to add notes based on specific value selections, ensuring that these notes are displayed only when the relevant selections are made. This ensures that the annotations remain context-specific and do not clutter the entire chart, providing a clearer and more focused analysis.
