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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Yonah
Helper II
Helper II

Measure Including Year Filter

Hi,
i have done a Measure to get the Revenue from TOP N Products.
N depends on the selected Value from my TOP-N Table (It's containing just the numbers from 1 to 10).
 In the same Measure, I also calculate how much was the revenue of all Products how were not in the selected Top N.
The Code for this is:

Top N Produktbez Sum DB3 =
VAR TopNSelected =
    SELECTEDVALUE ( 'TOP N-Filter'[TOP N] )
VAR TopNProdbezTable =
    TOPN ( TopNSelectedALLSELECTED ( 'Pseudo Produkbez Table' ), [DB3] )
VAR TopNProdbez =
    CALCULATE ( [DB3], KEEPFILTERS ( TopNProdbezTable ) )
VAR OtherSales =
    CALCULATE ( [DB3], ALLSELECTED ( 'Pseudo Produkbez Table' ) )
        CALCULATE ( [DB3], TopNProdbezTable )
VAR CurrentProd =
    SELECTEDVALUE ( 'Pseudo Produkbez Table'[Produktbezeichnung] )
RETURN
    IF ( CurrentProd <> "Others"TopNProdbezOtherSales )


Now I want to add Year as Filter.
I'm using the Year coming from the Date Hierarchy.
Unfortunately, I can't provide a sample yet.
If a sample is need, I will try to create own.

1 REPLY 1
v-janeyg-msft
Community Support
Community Support

Hi, @Yonah 

 

Yes, A sample is needed. Without data and context it's hard to tell where to put the year. Please share it.

 

Best Regards,
Community Support Team _ Janey

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.