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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
waldnerr
Helper I
Helper I

Ignore slicer selection for specific part of Dax measure

Hello,

i am using the subsequent measure to filter the TCV from the latest available project evalulation per project within a specific timeframe (year).

 

Latest TCV =
SUMX (
VALUES ( 'Project Period'[GlobalProjectKey] ),
CALCULATE (
SUM ( 'Project Period'[TCV] ),
LASTNONBLANK ('Date'[Date], COUNTROWS ( RELATEDTABLE ( 'Project Period' ) ) )
)
)
 

Date table (Datekey = project evaluation periods)

DatekeyDateYear
08/2208.08.20222022
08/2210.08.20222022
09/2205.09.20222022
.........

Project Period (Fact Table):

GlobalProjectKeyDateKeyFinal AcceptanceTCV
A08/2220231000
A09/2220221000
A10/2220231000
A11/2220231000
B08/2220224000
B09/2220224000

 

It is important, that within the selected timeframe (Year), always the latest evaluation line item is selected.

If i add an external slicer for the "Final Acceptance" date and select "2022", the measure selects the line item for project A with "Datekey" 09/22 and "Final Acceptance" 2022, which doesn't reflect the latest evaluation line item for this project with would be "Datekey" 10/22 and "Final Acceptance" 2023.

 

I would be happy, if you can show me a way to prevent that the "Final Acceptance" slicer selection influences the selection of the latest evaluation period (datekey per project) the wrong way.

 

Thank you,

Best regards,

 

Reinhard

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @waldnerr ,

 

Please try:

First create a new table for slicer:

vjianbolimsft_0-1667887577553.png

Apply the measure to the visual:

Measure =
VAR _a =
    MAXX (
        FILTER (
            'Project Period',
            YEAR ( [DateKey] ) = SELECTEDVALUE ( 'For slicer'[Value] )
        ),
        [DateKey]
    )
VAR _b =
    MAXX (
        FILTER (
            ALL ( 'Project Period' ),
            [GlobalProjectKey] = MAX ( 'Project Period'[GlobalProjectKey] )
                && YEAR ( [DateKey] ) = SELECTEDVALUE ( 'For slicer'[Value] )
        ),
        [DateKey]
    )
VAR _c =
    CALCULATE (
        SUM ( 'Project Period'[TCV] ),
        FILTER ( 'Project Period', [DateKey] = _a )
    )
RETURN
    IF ( _a <> _b, BLANK (), _c )

Turn on show items with no data:

vjianbolimsft_1-1667888806135.png

Then create two slicers using 'For Slicer'[Value] and 'Project Period'[Final Acceptance] separately

Final output:

vjianbolimsft_2-1667888985487.png

vjianbolimsft_3-1667889000405.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @waldnerr ,

 

Please try:

First create a new table for slicer:

vjianbolimsft_0-1667887577553.png

Apply the measure to the visual:

Measure =
VAR _a =
    MAXX (
        FILTER (
            'Project Period',
            YEAR ( [DateKey] ) = SELECTEDVALUE ( 'For slicer'[Value] )
        ),
        [DateKey]
    )
VAR _b =
    MAXX (
        FILTER (
            ALL ( 'Project Period' ),
            [GlobalProjectKey] = MAX ( 'Project Period'[GlobalProjectKey] )
                && YEAR ( [DateKey] ) = SELECTEDVALUE ( 'For slicer'[Value] )
        ),
        [DateKey]
    )
VAR _c =
    CALCULATE (
        SUM ( 'Project Period'[TCV] ),
        FILTER ( 'Project Period', [DateKey] = _a )
    )
RETURN
    IF ( _a <> _b, BLANK (), _c )

Turn on show items with no data:

vjianbolimsft_1-1667888806135.png

Then create two slicers using 'For Slicer'[Value] and 'Project Period'[Final Acceptance] separately

Final output:

vjianbolimsft_2-1667888985487.png

vjianbolimsft_3-1667889000405.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-jianboli-msft
Community Support
Community Support

Hi @waldnerr ,

 

Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-jianboli-msft,

 

thank you for your reply.

Subsequent please find the link to a sample pbix file which hopefully clarifies the scenario:

example.pbix 

Alternative Link 

Thank you,

Best regards,

Reinhard

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Solution Authors