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

sum with two filters dates

I have a TabelDate table [xt_date] that is linked to another PRODTABEL table,

I have two columns from the PRODTABEL table that are linked to the TabelDate [xt_date] table, PROTABEL [DATA_A] AND PRODTABEL [DATA_B].

The relationship that is active is the TabelDate [xt_date] ---> PROTABEL [DATA_A] relationship.

The PRODTABEL table has a third column that is PRODTABEL [VALUE]
.

I want to show on a card the sum of the value, for yesterday's date TabelDate [xt_date] ---> PROTABEL [DATA_B] (inactive relation). But that the sum that appears on the card is that the date TabelDate [xt_date], PROTABEL [DATA_A] is more than 12 months and less than 24 months.


Can anyone help me ? I apologize for not using the example image, but there is a sensitive date.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , did not get it completely

Something like this

Rolling 12 till last 24 month = CALCULATE(sum(PROTABEL [VALUE]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(PROTABEL [DATA_A],-12,month)),-12,MONTH),PROTABEL[DATA_B] =Today()-1)

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , did not get it completely

Something like this

Rolling 12 till last 24 month = CALCULATE(sum(PROTABEL [VALUE]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(PROTABEL [DATA_A],-12,month)),-12,MONTH),PROTABEL[DATA_B] =Today()-1)

 

vanessafvg
Super User
Super User

can you provide dummy data as an example as i am not sure i fully understand what you asking.

 

from what i can tell you  will need to use the userelationship function with a dateadd function with the yesterdays date.

 

https://docs.microsoft.com/en-us/dax/userelationship-function-dax

https://docs.microsoft.com/en-us/dax/dateadd-function-dax





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.