Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
henoktd
Regular Visitor

TOP N

henoktd_0-1736926964620.png

wha is the error here. 

TopDepartment =
CALCULATE(
    FIRSTNONBLANK(KPI[Department], 1),
    TOPN(1, ALL('KPI'), [DepartmentAchievement], DESC)
1 ACCEPTED SOLUTION
BeaBF
Super User
Super User

@henoktd Hi! Try with:

 

TopDepartment =
CALCULATE(
SELECTEDVALUE(KPI[Department]),
TOPN(1, ALL('KPI'), [DepartmentAchievement], DESC)
)

 

BBF

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @henoktd,

Any update on this? Can you please share some more detail information about this issue? They should help us clarify your scenario and test coding formula.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @henoktd ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
BeaBF
Super User
Super User

@henoktd Hi! Try with:

 

TopDepartment =
CALCULATE(
SELECTEDVALUE(KPI[Department]),
TOPN(1, ALL('KPI'), [DepartmentAchievement], DESC)
)

 

BBF

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors