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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors