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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jkd0007
Frequent Visitor

Output Value in new column based on "Date"-type column and another Column "text"-type value

I want to be able to output a specific value in a new created column but based off what is entered as the date and category type. 

 

For example I need all these to apply:

I need to output these values in a new column based off the data entered is within a specific month and falls under a category type.

jkd0007_0-1712334283040.png

 

Output "226.98" in [New Column] if date entered is before August 2024 [Date column] and if Category [2nd column] is in "Assy". 

Output "220.98" if date is after August 2024 and if Category is in "Assy". 

Output "94.016" if date is before August 2024 and if Category is in "Mach".

Output "92.004" if date is after August 2024 and if Category is in "Mach".

 

Tried using the Conditional Column feature on Transform data, but I couldn't get it to work.

Any help is appreciate.

 

Thanks!

1 ACCEPTED SOLUTION
jkd0007
Frequent Visitor

Nevermind. I figured it out. I added some code to the condition column too to refine my boundaries of date I wanted to capture and output specific values. Added some "else if" and "and" functions.

View solution in original post

3 REPLIES 3
jkd0007
Frequent Visitor

Nevermind. I figured it out. I added some code to the condition column too to refine my boundaries of date I wanted to capture and output specific values. Added some "else if" and "and" functions.

adudani
Super User
Super User

hi @jkd0007 ,

 

kindly provide the sample input in a table format.

 

Regardless, you could try:

1. unpivoting the data. ( Months as attributes (in a date format) with values).

2. then try with the calculated column conditions: if month <= August 2024 ( date format) , then value else null.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Using the method you mentioned above does not consider the other category type if it being Assy or Mach.

I used the method you mentioned before with the conditional columns, and yes it works if it was affected by 1 conditon (date), but I also have another condition (category column) to take into consideration for that output .

 

Example below.

Items in grey is what I need to output.

The 1st two columns are data that's been entered and populated as an example. 

 

jkd0007_1-1712338055223.png

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors