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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Apply a filter to a measure

Hi guy,

 

I'm on a problem and I not finding a kind of answer with my situation.

 

I'v created a measure like that (simplified one) :

 

    CALCULATE(
        SUM('Table1'[int]),
        'Table1'[date] >= DATE(2021, 06, 01),
        'Table1'[date] <= DATE(2021, 07, 31)
    )+
    CALCULATE(
        SUM('Table2'[int]),
        'Table2'[date] >= DATE(2021, 06, 01),
        'Table2'[date] <= DATE(2021, 07, 31)
    )

 

 
Not realy difficult and it's work perfectrly.

 

But, I would like to re-use this measure with another date with something like that :

 

 

    CALCULATE(
        [MyPreviousMeasure],
        FILTER('Table1', 
            ('Table1'[date] >= DATE(2021, 7, 01)) && ('Table1'[date] <= DATE(2021, 7, 31))
        ),
        FILTER('Table2', 
            ('Table2'[date] >= DATE(2021, 7, 01) && 'Table2'[date]<= DATE(2021, 7, 31))
    )

 

 I don't even know if it's possible to apply some filter on an existing measure.

 

Can you please help me out ? 😄

Thanks guys

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

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want.

yingyinr_0-1628152796336.png

In addition, you can refer the content in the following links to get it.

Filter two tables with one slicer

Filter two tables using the same filter in powerbi

Best Regards

Community Support Team _ Rena
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-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

I created a sample pbix file(see attachment), please check whether that is what you want.

yingyinr_0-1628152796336.png

In addition, you can refer the content in the following links to get it.

Filter two tables with one slicer

Filter two tables using the same filter in powerbi

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi, 

 

Yea that's an idea, but it can't be done, the amont of data will be huge.

The point here is not to use slicer or any component. 

For an example the amont au sell for the summer, and columns for june, july and august. 

SummerJuneJulyAugust
5025250
40101020
2010100

(This is not what I want to do, but this is the idea)

 

But, I wish i can call the "summer measure" and just change date without recreating the all measure because she's kind of complicated and long.  Just like factorization when coding...

amitchandak
Super User
Super User

@Anonymous , You create a date table, join it both tables, and the filter that using date slicer

 

CALCULATE(
[MyPreviousMeasure],
not(isblank('Table1'[date])), not(isblank('Table2'[date]))
)

 

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.