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
kasun_rumesh
Frequent Visitor

Dash board help

Hi,

I'm calculating selected date over 365 debtors using below dax and its giving me results which i wanted.

 

CALCULATE (
SUM ( BICus[Amount] ),
FILTER (
BICus,NOT ( DATEADD ( DocumentDates[Date], 365, DAY ) >MAX(DateDim[Date])))
 
I want to calculate the over 365 debtors for last month end without changing present date selection. I have try below dax and its not given me the results which i expected can anyone help me on this.
 
CALCULATE (
SUM ( BICus[Amount] ),
FILTER (
BICus,
NOT ( DATEADD ( DocumentDates[Date], 365, DAY ) >EOMONTH( MAX(DateDim[Date]),-1)))
 
4 REPLIES 4
kasun_rumesh
Frequent Visitor

Hi @v-zhangti ,

 

My date selection is 25-Feb-2022

 

Sample data set  
CustomerDocumentDates[Date]DateDim[Date]Document no
A13-Jan-2113-Jan-21IN-01
A13-Jan-2125-Jan-22PY-01
A13-Jan-2123-Feb-22PY-02
A13-Jan-2128-Mar-22PY-03
    
    
   last month end Over 365 (31-Jan-2022)Over 365 as at  25-Feb-2022
                                         13,000                                                       11,000
  Expected resultsThis one getting from above DAX

Hi, @kasun_rumesh 

 

What kind of BICus[Amount] field you mentioned in your formula and can you provide sample data? Are these tables connected by the Date field?

 

Best Regards

v-zhangti
Community Support
Community Support

Hi, @kasun_rumesh 

 

Can you provide some of the example data? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures.

 

Best Regards

My Date selection is 25-Feb-22

Customer InvoiceDatePostingDateDocumentNoInvoiceNoBICus[Amount]
A13-Jan-2113-Jan-21IN-01IN-0115,000
A13-Jan-2125-Jan-22PY-01IN-01(2000)
A13-Jan-2123-Feb-22PY-02IN-01(2000)
A13-Jan-2128-Mar-22PY-03IN-01(2000)

 

Last Month over 365 (31-Jan-22)Balance as at 25-Feb-22
13,00011,000
Searching resultsThis one getting from first dax

 

Yes, I have two date table. I have relationship as below. There's no relationship between two table

InvoiceDtae->DocumentDates[Date]

PostingDate->DateDim[Date]

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.