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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Date filter for month and year

Hi Experts

 

Cannot see my error on the following DAX...

 

i want to filter my sales for the year 2017 and month Feb only

Symbias Feb 17 = CALCULATE([Symbias, Inc organic Dynamic Measure],
        FILTER(ALLSELECTED(DateFilter),
                DATEDIFF([Year Nbr]=2017,DateFilter[Month Short Name]=Feb)))
1 ACCEPTED SOLUTION
themistoklis
Community Champion
Community Champion

OR 

@Anonymous

 

Symbias Feb 17 = CALCULATE(SUM([Symbias, Inc organic Dynamic Measure]), [Year Nbr] = 2017, [Month Short Name] = "Feb")

View solution in original post

6 REPLIES 6
themistoklis
Community Champion
Community Champion

OR 

@Anonymous

 

Symbias Feb 17 = CALCULATE(SUM([Symbias, Inc organic Dynamic Measure]), [Year Nbr] = 2017, [Month Short Name] = "Feb")
Anonymous
Not applicable

here is some sample data....

 

I am need to the following numbers... see image...Capture.PNG

here is my formula.....still cannot get it to work

Symbias Organic = CALCULATE(
        [Net Sales BM],
        FILTER(ALL('DateFilter'),[Year Nbr]=2017),DateFilter[Month Short Name]="FEB")

@Anonymous

 

You have accepted a solution so i dont know if you are happy with it, or you still have issues with the formula.

 

Now regarding the last message, the formulas is not correct. It should look like the following formula:

 

Symbias Organic = CALCULATE(
        SUM([Net Sales BM]),
        DateFilter[Year Nbr]=2017),
        DateFilter[Month Short Name]="FEB"
)

 

Anonymous
Not applicable

All Experts

 

I worked out the same formula that has just been posted. So i expected the solution which gave me the direction..as to how to work out the solution.

 

Thanks all for the excellent feedback

try this

Symbias Organic = CALCULATE(
        [Net Sales BM],
        FILTER(ALL('DateFilter'),[Year Nbr]=2017,DateFilter[Month Short Name]="FEB"))
Nastasita
Frequent Visitor

you do not need to use DateDiff function and Filter expression should be rewriting in such way

FILTER(ALL('TableName'),[Year Nbr]=2017,[Month Short Name]="Feb")

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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