Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I've searched, but didn't find anything that fit my problem.
I have budgets of every store (every store has own ID). Every store is also in some region. I want to create other table that will present only stores with TOP2 budgets in every region.
This is my example data:
and the result should be like:
Region1 - 101
Region1 - 102
Region2 - 103
Region2 - 104
Region3 - 106
Region3 - 108
I tried use GROUPBY function, but then I can obtain only TOP1 store in Region, but cannot apply that solution to have table with 2 stores with the highest budget.
Thx for yuor help
Solved! Go to Solution.
Hi @RobertO995
you can use the GENERATE function for this:
GENERATE(
ALLNOBLANKROW( Data[Region] ),
CALCULATETABLE(
TOPN(
2,
SELECTCOLUMNS(Data, "Budget", [Budget], "Store Number", [Store Number]),
[Budget]
)
)
)
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @RobertO995
you can use the GENERATE function for this:
GENERATE(
ALLNOBLANKROW( Data[Region] ),
CALCULATETABLE(
TOPN(
2,
SELECTCOLUMNS(Data, "Budget", [Budget], "Store Number", [Store Number]),
[Budget]
)
)
)
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 19 | |
| 19 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 33 | |
| 32 | |
| 32 |