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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
mussaenda
Super User
Super User

Put custom value between given dates

Hi,

 

I have this data:

Cust No  Posting Date

C1000110/02/2019
C1000126/02/2019
C1000110/04/2019
C1000130/04/2019
C1000130/04/2019
C1000108/05/2019
C1000115/05/2019
C1000115/05/2019
C1000115/05/2019
C1000129/05/2019
C1000129/05/2019
C1000129/05/2019
C1000129/05/2019
C1000129/05/2019
C1000129/05/2019
C1000129/05/2019
C1000129/05/2019
C1000130/06/2019
C1000130/06/2019
C1000130/06/2019
C1000130/06/2019
C1000130/06/2019
C1000102/07/2019
C1000114/08/2019
C1000114/08/2019

 

Then I would like to give a custom value like this:

24/02/2019 - 31/10/2019 : 242169

23/03/2019 - 31/10/2019 : 363003

11/07/2019 - 31/12/2019 : 216071

 

So Final output will be:

 

  Cust No          Posting Date     Value(calculated)

C10001       10/02/2019      242169
C1000126/02/2019242169
C1000110/04/2019605172
C1000130/04/2019605172
C1000130/04/2019605172
C1000108/05/2019605172
C1000115/05/2019605172
C1000115/05/2019605172
C1000115/05/2019605172
C1000129/05/2019605172
C1000129/05/2019605172
C1000129/05/2019605172
C1000129/05/2019605172
C1000129/05/2019605172
C1000129/05/2019605172
C1000129/05/2019605172
C1000129/05/2019605172
C1000130/06/2019821243
C1000130/06/2019821243
C1000130/06/2019821243
C1000130/06/2019821243
C1000130/06/2019821243
C1000102/07/2019821243
C1000114/08/2019821243
C1000114/08/2019821243
C1000114/11/2019216071

 

Adding the value depends on the date range.

 

I need to show this in data (column) not in a table visual.

This is possible, right?

Thank you! 

 

If i will put this in a table visual, this will be the output:

 

Date Slicer: 14/08/2019

Table Visual:

C10001  821243

 

Date Slicer: 29/05/2019

Table Visual:

C10001  605172

 

 

 

1 ACCEPTED SOLUTION

Download the PBI file from here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=CALCULATE(SUM(Data1[Value]),FILTER(Data1,Data1[Lower]<=EARLIER(Data[Posting Date])&&Data1[Upper]>=EARLIER(Data[Posting Date])))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Value is manual input.

How can I input the value?

2019_08_31_09_49_24_Put_custom_value_between_given_dates_Microsoft_Power_BI_Community.png

I do not understand your question/comment.  The Data1 Table is a 3 column Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

What I have is a 2 column table.

3 column table is my expected output  3rd column is calculated.

 

I am absolutely confused now.  I have created the 3rd column for your in Table1 as per your initial request.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

2019_08_31_10_11_50_Put_custom_value_between_given_dates_Microsoft_Power_BI_Community.png

Above photo is my data.

 

then I will put these values based on date on a calculated column. It is not existing on my current data.

2019_08_31_09_49_24_Put_custom_value_between_given_dates_Microsoft_Power_BI_Community.png

 

After the calculated column created, this is the expected output:

2019_08_31_10_16_53_Re_Put_custom_value_between_given_dates_Microsoft_Power_BI_Community.png

 

Then if i will create a visual, this is the expectec output:

 

2019_08_31_10_12_45_Put_custom_value_between_given_dates_Microsoft_Power_BI_Community.png

 

My formula returns the third column shown in your Final Output Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Can you share the pbix?

Download the PBI file from here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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