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
CJMolin
Helper II
Helper II

Calculate an aggregated sum with 2 dynamic ref dates (calculated column)

Hello!
I am a new member to this forum but been browsing the topics quite frequently since i started to use the DAX language. Unfortunately I’ve now got stuck and would love to reach out to you and see if there are any solution(s) to my problem.

I am having a table with a datestamp which I want to use dynamically in order to calculate how many contracts that has been sent out during this dynamic period of time (as a calculated column, not a measure).
Eg. I want to sum how many contracts has been sent out between StartDt and EndDt relative to the Date shown in Table 1.


This is the data I have

Table 1

DateContract (1/0)CalculatedColumn
2017-05-011 
2017-05-011 
2017-05-070 
2017-05-091 


Table 2

Date (key)StartDt (-120 days from Date)EndDt (-30 days from Date)
2017-05-012017-01-012017-04-01
2017-05-022017-01-022017-04-02
2017-05-032017-01-032017-04-03
etc......


The DAX-expression used to far is:

=CALCULATE(SUM(DecisionFilter[DocsCustomer (1/0)]);FILTER(ALL(DecisionFilter);DecisionFilter[DateDocsCustomer]<=MAX(DecisionFilter[DateDocsCustomer]))) which only generated how many Contracts that has been sent out in total..

Please help me!
Thank you very much in advance,
CJ

0 REPLIES 0

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.