The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Team - I have table of 100 rows as below
Need a Measure to add top 3 rows.. only on population (total = 6)
I googled but could not find any
Country | Population |
aa | 2 |
bb | 3 |
cc | 1 |
dd | 10 |
Solved! Go to Solution.
Hi,
I tried to create a sample pbix file like below.
The top 3 sum is depending on the index of the country.
Population measure: =
SUM( Data[Population] )
WINDOW function (DAX) - DAX | Microsoft Learn
expected result measure: =
CALCULATE (
[Population measure:],
KEEPFILTERS (
WINDOW (
1,
ABS,
3,
ABS,
ALL ( Data[Country Index], Data[Country] ),
ORDERBY ( Data[Country Index], ASC )
)
)
)
Hi,
I tried to create a sample pbix file like below.
The top 3 sum is depending on the index of the country.
Population measure: =
SUM( Data[Population] )
WINDOW function (DAX) - DAX | Microsoft Learn
expected result measure: =
CALCULATE (
[Population measure:],
KEEPFILTERS (
WINDOW (
1,
ABS,
3,
ABS,
ALL ( Data[Country Index], Data[Country] ),
ORDERBY ( Data[Country Index], ASC )
)
)
)
User | Count |
---|---|
25 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |