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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Filter Between 2 dates

Hello, 

I'm pretty new to DAX and I'm trying to solve a problem. 

I need to calculate the sum of Fees from the year to a date


Here is an exemple

Date 1           | Date 2           | Fees

01/2018        | 06/2018        | 5

02/2018        | 03/2018        | 3

03/2018        | 08/2018        | 14

11/2017        | 06/2019        | 21

If I pick Date 1 = 03/2018 & Date 2 = 06/2018 my result should be 8 

If I pick Date 1 = 03/2018 & Date 2 = 08/2018 my result should be 22

If I pick Date 1 = 12/2017 & Date 2 = 06/2018 my result should be 21 

 

I used this formula : 

Fees = 
    CALCULATE(
        SUM('Fraisdesante-20190926'[frais_base]);
            FILTER( 
                ALL('Fraisdesante-20190926'[monthid_soins_date]);
                    'Fraisdesante-20190926'[monthid_soins_date] <= MAX('Fraisdesante-20190926'[monthid_soins_date]) 
                );
             FILTER(
                ALL('Fraisdesante-20190926'[monthid_soins_date]);
                    YEAR('Fraisdesante-20190926'[monthid_soins_date]) = YEAR(MAX('Fraisdesante-20190926'[monthid_soins_date]))
               );
            FILTER( 
                ALL('Fraisdesante-20190926'[monthid_compt_date]);
                'Fraisdesante-20190926'[monthid_compt_date] <= MAX('Fraisdesante-20190926'[monthid_compt_date]) 
                );
            FILTER(
                ALL('Fraisdesante-20190926'[monthid_compt_date]);
                YEAR('Fraisdesante-20190926'[monthid_compt_date]) = YEAR(MAX('Fraisdesante-20190926'[monthid_compt_date]))))

But when I pick the case : Date 1 = 12/2017 & Date 2 = 06/2018 

the result is <Blanck> 

 

Thanks in advance

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

@Anonymous 

 

You may drag [Date] from a separate calendar table and apply virtual relationship in DAX measure.

Community Support Team _ Sam Zha
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

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You may drag [Date] from a separate calendar table and apply virtual relationship in DAX measure.

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors