Forum Discussion
M2M
8 years agoFrequent Visitor
Top 1 Of Max
Hello, I am a newbie to PowerBI trying to grasp some fundamental concepts.I have a sample dataset(screenshot and file attached) with the post. What I am trying to do here is to get the Top1 o...
- 8 years ago
If you have many branches..then may be you can use this
New Table = ADDCOLUMNS ( SUMMARIZE ( Sample1, Sample1[Branches], "Max Total", MAX ( Sample1[Total] ) ), "Max Book Resale", CALCULATE ( MAX ( Sample1[Book Resale - SALE] ), Sample1[Total] = EARLIER ( [Max Total] ) ), "Inside Sales", CALCULATE ( MAX ( Sample1[Inside Sales.Inside Sales Name] ), Sample1[Total] = EARLIER ( [Max Total] ) ), "Manufacturer", CALCULATE ( MAX ( Sample1[Manufacturer Inside Sales Person] ), Sample1[Total] = EARLIER ( [Max Total] ) ) ) - 8 years ago
Hi M2M
This is an even better way of achieving the results
Table = GENERATE ( SELECTCOLUMNS ( SUMMARIZE ( Sample1, Sample1[Branches] ), "MyBranches", [Branches] ), CALCULATETABLE ( TOPN ( 1, Sample1, Sample1[Total], DESC, Sample1[Book Resale - SALE], DESC ) ) )
M2M
8 years agoFrequent Visitor
Thanks Zubair.I had to tweak your solution a little bit to get it working, :smileyhappy:
Zubair_Muhammad
Community Champion
8 years agoHi M2M
This is an even better way of achieving the results
Table =
GENERATE (
SELECTCOLUMNS (
SUMMARIZE ( Sample1, Sample1[Branches] ),
"MyBranches", [Branches]
),
CALCULATETABLE (
TOPN ( 1, Sample1, Sample1[Total], DESC, Sample1[Book Resale - SALE], DESC )
)
)