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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
grudginluv20
New Member

Find average of filtered key word from on table across another linked table in new measure

In powerBI, i have a table called Nodes.

Within that table there are string columns called caption with a list of names.

 

I have a second table called ResponseTime,

within that table I have column called Availability that are populated with interger values for availability .

 

The two tables Nodes and ResponseTime are linked with primary key NODE_ID.

Each caption from nodes table has a reference of availability value from ResponseTime table.

 

I want to create a measure that filters out only caption values that contains 'pub-rt' and computes the average of all caption values of that contain 'pub-rt' with their average availability value.

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

Hi @grudginluv20 ,

Below is my Node table:

vxiandatmsft_0-1713837969415.png

Below is my ResponseTime Table:

vxiandatmsft_1-1713837989250.png

The following DAX might work for you:

AverageAvailabilityForPubRT = 
CALCULATE(
    AVERAGE(ResponseTime[Availability]),
    FILTER(
        Nodes,
        CONTAINSSTRING(Nodes[Caption], "pub-rt")
    ),
    USERELATIONSHIP(Nodes[NODE_ID], ResponseTime[NODE_ID])
)

The final output is shown in the following figure:

vxiandatmsft_2-1713838084039.png

Best Regards,

Xianda Tang

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

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file.  Show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-xiandat-msft
Community Support
Community Support

Hi @grudginluv20 ,

Below is my Node table:

vxiandatmsft_0-1713837969415.png

Below is my ResponseTime Table:

vxiandatmsft_1-1713837989250.png

The following DAX might work for you:

AverageAvailabilityForPubRT = 
CALCULATE(
    AVERAGE(ResponseTime[Availability]),
    FILTER(
        Nodes,
        CONTAINSSTRING(Nodes[Caption], "pub-rt")
    ),
    USERELATIONSHIP(Nodes[NODE_ID], ResponseTime[NODE_ID])
)

The final output is shown in the following figure:

vxiandatmsft_2-1713838084039.png

Best Regards,

Xianda Tang

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

Thank you! This totally solved my problem.

 

As a follow up question, with the same principle, how get the average value for 'pub-rt' and 'bbb' together as one.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.