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
Anonymous
Not applicable

DAX: filtering with date placeholders

Hello there,

 

I have the following situation: 

 

I have two tables:

  • transactions
  • users

TRANSACTIONS

iduserIdtypecreatedAtprocessedAmount
     
     

USERS

idname[Calculated] Deposits[Calculated] Withdrawals[Calculated] Net Deposit
     
     

 

 

Deposits = 
    CALCULATE(
        SUM('transactions'[processedAmount]), 
        FILTER (
            ALL('transactions'),
            'transactions'[userId] = 'users'[id]
            && ('transactions'[type] = "deposit")
        ) 
    )

Withdrawals = 
    CALCULATE(
        SUM('transactions'[processedAmount]), 
        FILTER (
            ALL('transactions'),
            'transactions'[userId] = 'users'[id]
            && ('transactions'[type] = "withdrawal")
        ) 
    )

Net Deposit = [Deposits] - [Withdrawals]

 

 

 

 

 

 

 

I want to create a date filter with the createdAt value. However, I missed this binding when created calculated columns. Is it any way to use the FILTER in Dax with date placeholders so the slicer will affect such columns.

 

Thanks in advance.

 
 
 
 
 
1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

You could use measure to achieve this goal. You could refer to my sample for details.

Best Regards,
Zoe Zhi

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

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , Not very clear. You can join created at (Without time stamp), with a date table, and use that in the filter ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I don't think so. 

Actually, I have two calculated columns: Deposits and Withdrawals
I created the slicer contained the createdAt values from the TRANSACTION table. 


For example,

I specify the date range: 1/1/20 - 1/1/21.

I need to get the Sum of all processedAmounts with type = Deposit which was created in the specified date range (the same for Withdrawals), but I'm getting all deposits.

 
 
 
 
 
dax
Community Support
Community Support

Hi @Anonymous ,

I am not clear about your requirement, if possible could you please inform me more detailed information(such as your expected output and your sample data )? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

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 Zoe,

 

Thanks for your reply! Here you can find the file with sample data: https://drive.google.com/file/d/1w__Dy-dWfSB9KQomgWHqKPpnrAk2vn30/view?usp=sharing

 

On the dashboard, you can see one slicer and two tables. Slicer works only for one table, I need for both.

dax
Community Support
Community Support

Hi @Anonymous , 

You could use measure to achieve this goal. You could refer to my sample for details.

Best Regards,
Zoe Zhi

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

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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