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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ritar_li
Frequent Visitor

Need remark dates in one column based on another column.

Hi,

Our billing team billed services for Jan and Feb together on 3/31/2022. Now I need to separate those services occurred in Jan from services completed in Feb.

First step, I convert the “complete date” to a “MM-YYYY”. Then I write a DAX:

Billing date-mod =

if('table'[Completion date MM-YYYY]="1-2022"&&('table'[Billing Date]=DATE(2022,3,31)),

DATE(2022,02,15),

'table'[Billing Date])

Unfortunately, in the column of Billing date-mod, all cells are 3/31/2022. I need January service billing date is 2/15, and the rest keeps same as billing date.

Anyone can help me to troubleshoot the problem? 

I greatly appreciate your help. 

 

Service ID

Complete date

Billing date

Complete Date-MM-YYYY

Billing date-mod

1

1/5/2022

3/31/2022

1-2022

 

2

1/5/2022

3/31/2022

1-2022

 

3

1/7/2022

3/31/2022

1-2022

 

4

1/10/2022

3/31/2022

1-2022

 

5

2/5/2022

3/31/2022

2-2022

 

6

2/10/2022

3/31/2022

2-2022

 

7

2/10/2022

3/31/2022

2-2022

 

8

2/15/2022

3/31/2022

2-2022

 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@ritar_li good to hear, accept the solutions so that others can take advantage of this as well.

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@ritar_li good to hear, accept the solutions so that others can take advantage of this as well.

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@ritar_li I think this is what you are looking for:

 

New Column = 
IF ( EOMONTH ( Table[Completed Date], 0 ) = DATE(2022,1,31) && Table[Billing Date] = DATE(2022,03,31 ), DATE(2022,2,15), Table[Billing Date] )

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you so much. It works. 

ritar_li
Frequent Visitor

Hi,

I'm sorry for confusion. 

I want to create a billing date column.

Some service charges, which were completed in the beginning of Jan 2022, were invoiced on 1/26/2022. I want to keep those services' billing dates as 1/26/2022. I want services which completed in Jan 2022 and billed on 3/31 use billing date 2/15/2022. The rest of billing dates keep as it is. 

Hope I make my question is clear. 😀

Thanks again.

 

parry2k
Super User
Super User

@ritar_li what do you want to happen in this case? Can you explain the full logic?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@ritar_li try this calculated column:

 

New Column = 
IF ( EOMONTH ( Table[Completed Date], 0 ) = DATE(2022,1,31), DATE(2022,2,15), Table[Billing Date] )

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you so much! It works perfectly. 

However, I found new problem. Billing team also send some invoices in 1/26/2022. I listed in a new table below. If I use the DXA you provided, the total charges/per month shift. 

How can I fix this problem?

 

Service ID

Complete date

Billing date

Billing date-mod

1

1/5/2022

3/31/2022

 

2

1/5/2022

3/31/2022

 

3

1/7/2022

3/31/2022

 

4

1/10/2022

3/31/2022

 

5

2/5/2022

3/31/2022

 

6

2/10/2022

3/31/2022

 

7

2/10/2022

3/31/2022

 

8

2/15/2022

3/31/2022

 

9

1/6/2022

1/26/2022

 

10

1/2/2022

1/26/2022

 

11

1/4/2022

1/26/2022

 

 

Hi,

Clearly show the expected result in another column.


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

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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