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
aqavi10
Advocate I
Advocate I

Top value in a category based on 2 columns

Hi everyone,

 

  Can someone please help me accomplish this task below? I need to display the store with the highest sales in a 'Card' visual. This needs to be categorized based on the 'State' and the 'Year'. Ultimately, I would want to slice by 'Year' and 'State' and the 'Card' visual should display the store with highest sales in that 'State' in that 'Year'. 

 

The data below has sales for 2018 & 2019 and is a sample for a few stores. I have tried to create a calculated table where after using the Rank & Filter function , I was able to get a table with top rank/'Rank1' stores(ranked by sales) for each state in 2018 & 2019. But I'm unable to connect it with the main data table since it is a many to many relationship and the keys to connect would be 'Year' &'State' but it would only use 1 relationship to connect.

 

Thank you

 

WeekYearMonth StoreNameStateTotalDollarSales
112018March Store Wynnum WestQueensland10239.24
112018MarchStore MaroochydoreQueensland11972.33
112018MarchStore BairnsdaleVictoria12706.75
112018MarchStore Mosman ParkWestern Australia5730.57
112018MarchStore BeenleighQueensland11705.45
112018MarchStore ArmadaleWestern Australia10301.74
112018MarchStore Belmont Forum (Rebadge 368)Western Australia17674.32
112018MarchStore FindonSouth Australia12890.7
112018MarchStore KatoombaNew South Wales9662.39
112018MarchStore CamdenNew South Wales8156.99
112018MarchStore Kurri KurriNew South Wales19059.99
112018MarchStore Bay City (Geelong)Victoria5772.15
112018MarchStore Bondi Junction EastgateNew South Wales12090.18
112018MarchStore Port Adelaide Church StreetSouth Australia17561.86
112018MarchStore PalmerstonNorthern Territory10243.56
112018MarchStore BraybrookVictoria12917.27
112018MarchStore KaleenAustralian Capital Territory6310.24
112018MarchStore ChisholmAustralian Capital Territory7865.25
112018MarchStore WaniassaAustralian Capital Territory7469.3
112018MarchStore Alexander HeightsWestern Australia12050.61
112018MarchStore LutwycheQueensland8639.26
112018MarchStore ParalowieSouth Australia9039.99
112018MarchStore EngadineNew South Wales8723.82
112018MarchStore Ferntree GullyVictoria7688.41
112018MarchStore Fairfield (QLD)Queensland8118.32
112018MarchStore Dandenong PlazaVictoria15150.77
112018MarchStore Mount Barker (Cameron Street)South Australia14722.16
112018MarchStore Parramatta NorthNew South Wales11126.07
112018MarchStore Wattle GroveNew South Wales12526.99
112018MarchStore MowbrayTasmania9864.16
112018MarchStore DevonportTasmania16066.54
112019MarchStore Wynnum WestQueensland10739.24
112019MarchStore MaroochydoreQueensland12472.33
112019MarchStore BairnsdaleVictoria13456.75
112019MarchStore Mosman ParkWestern Australia6230.57
112019MarchStore BeenleighQueensland12205.45
112019MarchStore ArmadaleWestern Australia10801.74
112019MarchStore Belmont Forum (Rebadge 368)Western Australia18174.32
112019MarchStore FindonSouth Australia13390.7
112019MarchStore KatoombaNew South Wales10162.39
112019MarchStore CamdenNew South Wales8656.99
112019MarchStore Kurri KurriNew South Wales19559.99
112019MarchStore Bay City (Geelong)Victoria6272.15
112019MarchStore Bondi Junction EastgateNew South Wales12590.18
112019MarchStore Port Adelaide Church StreetSouth Australia18061.86
112019MarchStore PalmerstonNorthern Territory10743.56
112019MarchStore BraybrookVictoria13417.27
112019MarchStore KaleenAustralian Capital Territory6810.24
112018MarchStore ChisholmAustralian Capital Territory9853.25
112018MarchStore WaniassaAustralian Capital Territory6933.52
112019MarchStore Alexander HeightsWestern Australia12550.61
112019MarchStore LutwycheQueensland9139.26
112019MarchStore ParalowieSouth Australia9539.99
112019MarchStore EngadineNew South Wales9223.82
112019MarchStore Ferntree GullyVictoria8188.41
112019MarchStore Fairfield (QLD)Queensland8618.32
112019MarchStore Dandenong PlazaVictoria15650.77
112019MarchStore Mount Barker (Cameron Street)South Australia15222.16
112019MarchStore Parramatta NorthNew South Wales11626.07
112019MarchStore Wattle GroveNew South Wales13026.99
112019MarchStore MowbrayTasmania10364.16
112019MarchStore DevonportTasmania16566.54

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

13 REPLIES 13

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.