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.
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 of the Max Total for the branches.The sample dataset has only one branch there can be n number of such branches.The Dax query should return the row that I have highlighted in the screesnshot.It is similar to using Row Number parition in SQL
Data : Sample Data
Solved! Go to Solution.
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] ) ) )
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 ) ) )
Please any help on this ?
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] ) ) )
Thanks Zubair.I had to tweak your solution a little bit to get it working,
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 ) ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |