Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
PBI Rock Stars: I have a matrix which displays the top 30 cities by sales volumes [see below] -- each city is comprised of a list of restaurants that report TABC sales. Would like to create a measure that returns the top performing restaurantt for each city based on 'TABC Sales'. Is this possible?
Thank you so much! ~AGS
Solved! Go to Solution.
Measure code:
Measure =
var _maxSales =MAXX(ALLEXCEPT('Table','Table'[Region]),CALCULATE(SUM('Table'[TABC Sales]),ALLEXCEPT('Table','Table'[Region],'Table'[Restaurant])))
var _restaurant= CALCULATE(SELECTEDVALUE('Table'[Restaurant]),FILTER(ALLEXCEPT('Table','Table'[Region]),CALCULATE(SUM('Table'[TABC Sales]),ALLEXCEPT('Table','Table'[Region],'Table'[Restaurant]))=_maxSales))
return IF(ISINSCOPE('Table'[Restaurant])||NOT(HASONEFILTER('Table'[Region])),BLANK(),_restaurant)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Measure code:
Measure =
var _maxSales =MAXX(ALLEXCEPT('Table','Table'[Region]),CALCULATE(SUM('Table'[TABC Sales]),ALLEXCEPT('Table','Table'[Region],'Table'[Restaurant])))
var _restaurant= CALCULATE(SELECTEDVALUE('Table'[Restaurant]),FILTER(ALLEXCEPT('Table','Table'[Region]),CALCULATE(SUM('Table'[TABC Sales]),ALLEXCEPT('Table','Table'[Region],'Table'[Restaurant]))=_maxSales))
return IF(ISINSCOPE('Table'[Restaurant])||NOT(HASONEFILTER('Table'[Region])),BLANK(),_restaurant)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
you can prevent interaction between two visuals using edit interactions then blocking it
Proud to be a Super User!
@AaronGlenn10 in this case you can create a column to filter out max value for each region like below
then in your visual keep the top from MaxValue filter applied so that only top values are visible in matrix
Proud to be a Super User!
Thank you -- the measure appears to be overriding the 'Top Filter' I have applied in the Matrix Visual. Is there a way to prevent?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
76 | |
61 | |
37 | |
33 |
User | Count |
---|---|
99 | |
56 | |
51 | |
42 | |
40 |