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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to get value based date filter

 i have data table values and date column 

 

Table 1

 

sales    period              flag 

450     01-03-2021       1

234    01-04-2021         2

450     01-05-2021       3

234    01-06-2021         4

450     01-07-2021       5

234    01-08-2021         6

 

i am trying to get value  june month  value on using dax filter 

 

junval=calculate(sum(sales),filter(table1,table1[period]='01-06-2021')) 

 

but this measure not working . any idea how to get values based on the date column

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

If your period is stored as a text data type, then I'd expect this to work:

junval =
CALCULATE (
    SUM ( table1[sales] ),
    FILTER ( table1, table1[period] = "01-06-2021" )
)

Note that sales needs to table1[sales] and I used " instead of '.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Picture1.png

 

junval =
CALCULATE (
SUM ( Table1[sales] ),
FILTER ( table1, MONTH ( Table1[period] ) = 6 )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
AlexisOlson
Super User
Super User

If your period is stored as a text data type, then I'd expect this to work:

junval =
CALCULATE (
    SUM ( table1[sales] ),
    FILTER ( table1, table1[period] = "01-06-2021" )
)

Note that sales needs to table1[sales] and I used " instead of '.

Anonymous
Not applicable

@AlexisOlson  period stored as a date format 

Then you can use DATE ( 2021, 6, 1 ) instead of "01-06-2021" or else the month = 6  approach @Jihwan_Kim suggests.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.