Forum Discussion
Measure that counts in second column
- 2 years ago
I have solved it simply: With an additional column in data, which calculates the number per primary residence location, but in primary and secondary residence. This means that all rows with the same location always contain the same value.
The measure then only needs to add a MAX (or MIN or AVG) to the new column 😉
Hi MichaelH78 ,
First of all, many thanks to for your very quick and effective replies.
Based on my testing, please try the following methods:
1.Create the simple table.
2.Create the new measure to calculate the number of city primary residence.
Count primary city =
var cit_ = SELECTEDVALUE('Table city'[City])
RETURN
COUNTROWS(FILTER('Table', 'Table'[Primary residence (city)] = cit_))Count secondary city =
var cit_ = SELECTEDVALUE('Table city'[City])
RETURN
COUNTROWS(FILTER('Table', 'Table'[Secondary residence (city)] = cit_))
3.Create the new measure to calculate the count.
Count = [Count primary city] + [Count secondary city]
4.Drag the category field into the slicer.
5.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Wisdom Wu,
hi, thanks for your help. This looks very good and also works in Power BI.
Before I transfer everything to Power BI: Does this also work in Excel? Power Pivot in Excel does not recognise SELECTEDVALUE. You can probably do something with HASONEVALUE, but I can't manage that 😉
Best regards
Michael
- MichaelH782 years agoFrequent Visitor
I have solved it simply: With an additional column in data, which calculates the number per primary residence location, but in primary and secondary residence. This means that all rows with the same location always contain the same value.
The measure then only needs to add a MAX (or MIN or AVG) to the new column 😉