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! Request now

Reply
dfervwrqqq
New Member

Measure with two filters (one with function ALL)

Hi,

 

I have measure like this:
```

Measure=
VAR __year =
    FORMAT ( TODAY (), "YYYY" )
VAR numerator =
    CALCULATE (
        DISTINCTCOUNT ( Fact_Table[Order Number] ),
        FILTER(ALL(Calendar[Date (Year)]), Calendar[Date (Year)] = __year),
        FILTER(Fact_Table,Fact_Table[Area] = "condition")
    )
RETURN
    numerator

```

I have some issue. To be more specific, when I switch the year from 2023 to 2022 I only see the value 'Blank()'. But my expected result should be value from 2023 (always, regardless of the selected year). Do you know, how should I change this measure? Thanks in advance.

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi @dfervwrqqq ,

Have you solved your problem? If solved please mark the reply in this post which you think is helpful as a solution to help more others facing the same problem to find a solution quickly, thank you very much!

Best Regards,

Xianda Tang

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

Ced-Alcaraz
Regular Visitor

@dfervwrqqq 
Create a helper table that contain all the distinct years.

Year

2022

2023

 

Measure = 
var _selectedYear = MAX(HELPERTABLE[Year])

 

RETURN

CALCULATE (
        DISTINCTCOUNT ( Fact_Table[Order Number] ),
        FILTER(Calendar[Date (Year) = _selectedYear)
    )
 
*Slicer value should be the Year column of the Helper Table
*No relationship between main table and helper table

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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