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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 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.