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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Maescobar
Helper I
Helper I

Multiple Date filters for one amount column

Hey everyone,

I think my previous post was marked as spam for some reason. Anyway, is there anyone who can help me achieve the result below?

 

I have a set of data with info on invoices: their accrued date, payment date and gross amount.date,

Date AccrualDate Payment Gross Amount 
01/04/201926/09/2019169.56
01/04/201925/07/2019165.18
01/04/201927/05/2019138.02
01/04/201925/04/2019268
01/08/201831/08/2018238.4
01/08/201826/11/201892.14
01/08/201821/12/2018633.83
01/08/201827/05/201919.72
01/12/201828/12/201880.4
01/12/201821/12/2018187.91
01/12/201821/12/201892.32

 

I want to build a Dashboard using the following:

  1. Stacked chart filtered by "MMM/YYYY"
  2. Two values: i) SUM of the gross amount accrued and ii) SUM of the gross amount paid BOTH with the same MMM/YYYY filter

Example:

Filter = Apr/2019, results in: 

  1. First line = 740.76
  2. Second line = 268
 
 
 
1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Maescobar ,

 

Please check:

Payment =
CALCULATE (
    SUM ( 'Table'[GrossAmount] ),
    USERELATIONSHIP ( Dates[Date], 'Table'[Date Payment] ),
    FILTER ( 'Table', 'Table'[Date Accrued] IN VALUES ( Dates[Date] ) )
)

payment.PNG

 

Best Regards,

Icey

 

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

9 REPLIES 9
amitchandak
Super User
Super User

@Maescobar , You can create a common Date dimension and Join both dates with it. One will be active and another will be inactive. You can active it the relation using userelation :https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

 

@amitchandak  

Hi, thanks for taking your time. Congrats on this solution. It show a real world complex problem solution.

I have tried this using "userelationship" but it only gives me how much I paid in a given month AND how much was accrued in the same month.

 

What I wanted is how much of the accrued month I paid inside the accrued month 😕

 

ddd.png

Icey
Community Support
Community Support

Hi @Maescobar ,

 


 

ddd.png

 


Is this what you want?

Please let me know the calculation principles of "Gross Amount Accrued" and "Gross Amount Paid".

What I create in Power BI is something like so:

accrual.PNG

 

 

Best Regards,

Icey

 

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

Hi @Icey 

Thanks for sharing. Somehow my sample on the post might have led us to produce wrong results.

 

I am sharing a more populated database. 

Fact Sheet 

 

When I filter July/2019 and August/2019, I am expecting the following results 

Month Accrued Amount  Paid Amount 
Jul-19          2,929,327.70 1,525,099.44
Aug-19          2,252,308.04 1,956,810.80
Icey
Community Support
Community Support

Hi @Maescobar ,

 

Sorry, I have no right to agree here. Please share me the file using other tools, like OneDrive for Business.

agree.PNG

 

 

Best Regards,

Icey

@Icey 

I only have permission to save to google drive. Hope this works.

Fact Sheet2 

Icey
Community Support
Community Support

Hi @Maescobar ,

 

What's the calculation logic of [Paid Amount]?

 

 

Best Regards,

Icey

@Icey 

It is to know: out of the total accrued amount for month MMM/YYYY, how much was paid inside that same MMM/YYYY?

 

If you filter the fact sheet attached in the previous message, it shuold return the values below:

Month Accrued Amount  Paid Amount 
Jul-19          2,929,327.70 1,525,099.44
Aug-19          2,252,308.04 1,956,810.80

 

thanks

Icey
Community Support
Community Support

Hi @Maescobar ,

 

Please check:

Payment =
CALCULATE (
    SUM ( 'Table'[GrossAmount] ),
    USERELATIONSHIP ( Dates[Date], 'Table'[Date Payment] ),
    FILTER ( 'Table', 'Table'[Date Accrued] IN VALUES ( Dates[Date] ) )
)

payment.PNG

 

Best Regards,

Icey

 

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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