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
xariet
Helper I
Helper I

TOP N

I have the following calculation for the top N projects

Top N Projects =
VAR SelectedTop = SELECTEDVALUE('Top N'[Top N])
RETURN
SWITCH(TRUE(),
    SelectedTop = 0, [Revenue],
    RANKX (
            ALLSELECTED(  'fin fact'[dim project key]),
            [Revenue]
                )
                  <= SelectedTop,
        [Revenue]
)
 
Table 'fin fact' is connected to the 'Project dim' table  by the  [dim project key].  So when I bring to the table  [Top N Projects] and [dim project key] it is filtering just fine with the TopN slicer. But if I want to bring [Progect Name] from the 'Project dim' table , my viz breaks and do not filter by top N slicer anymore. What am I missing in the calculation? The Tables connected correctly 
1 REPLY 1
amitchandak
Super User
Super User

@xariet , Please consider TOPN and window

Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors