Forum Discussion
Need help on Creating a measure based on another table's Column
Ok, so the following should work:
_AppCount =
CALCULATE(
DISTINCTCOUNT(Table2[ComputerID]),
FILTER(
ALL(Table2),
CONTAINSSTRING(Table2[ApplicationName], "CrowdStrike")
)
)
// OR
_AppCount =
CALCULATE(
DISTINCTCOUNT(Table2[ComputerID]),
FILTER(
ALL(Table2),
Table2[ApplicationName] = "CrowdStrike"
)
)
Pete
I wanted to query Table2 Application Column based on Table1 Computer ID. So i used the folowing query but the measure value changes
Should i go for calculated column to overcome this scenario
_AppCount =
CALCULATE(
DISTINCTCOUNT(Table1[ComputerID]),
FILTER(
ALL(Table2),
CONTAINSSTRING(Table2[ApplicationName], "CrowdStrike")
)
)- BA_Pete3 years agoSuper User
I'm struggling to understand why you need to involve Table1 in your measure.
You have [ComputerID] in Table2 that you can use to count, and you have a ONE:MANY relationship between the two tables, so all of Table1 is already included in the expanded version of Table2.
What am I missing here?
Pete
- Krishna1990_PBI3 years agoNew Member
Let's assume measure is created. In first image, card created using table2 and Pie Chart created using Table1.
When i made any selection within the pie chart, measure value also changing. It should not happen in my case.. How can we avoid that