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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

DAX Date Column Not Working

Hello. I am trying to create a calculated column with DAX using if statements. I created a measure that works and outputs what I want it to but when I cannot put this measure into the chart as it does not let me. I tried creating a DAX column instead and it outputs a single date for some reason and I am not sure why. How would I use this calculation in a visual other than a table and would I be able to use it in a column? One note is that I am using 2 excel files with a relationship. Not sure if that would affect it.

dbockra_0-1663856216611.png-> measure that works correctly output into table

dbockra_1-1663856229060.png

This is the measure I created.

dbockra_2-1663856238038.png-> Same measure used as a calculated column instead

 

 

 

 

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

As checked the formula of your measure, it involves two tables('Project_Number_and_Deadline' and 'forecast_and_actuals_data') and multiples date fields. How did you create the relationship between these two tables? Which table you are creating the calculated column in? Could you please provide some raw data of these two tables and the logic of [calculation date]? Then we can give you a suitable solution later... Thank you.

yingyinr_0-1663914246233.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

The relationship is many to many. I am connecting project numbers to each other to get the deadline date but the 'Project Number and Deadline' has more project numbers than the other document. Forecast and Actuals is where the main data is coming from. I will share some data to give you an idea. I tried to create the column in both tables but neither worked. It works as a measure in table visualization but I cannot use it in a graph, which is what I need it for.

dbockra_0-1663935491372.png

 

Due Date = IF(MAX('Project_Number_and_Deadline'[Deadline])>(TODAY()),MAX(Project_Number_and_Deadline[Deadline]),IF(MAX('Project_Number_and_Deadline'[Deadline])>(TODAY()-45),TODAY(),IF(MAX('forecast_and_actuals_data'[Promise Date])<>BLANK() && MAX(forecast_and_actuals_data[Promise Date])>TODAY(),MAX('forecast_and_actuals_data'[Promise Date]),IF(MAX('forecast_and_actuals_data'[Scheduled Ship Date])>(TODAY()) && MAX(forecast_and_actuals_data[Scheduled Ship Date])<(TODAY()+60),MAX(forecast_and_actuals_data[Scheduled Ship Date]),IF(MAX('forecast_and_actuals_data'[Scheduled Ship Date])>(TODAY()+60) && MAX(forecast_and_actuals_data[Scheduled Ship Date])<(TODAY()+120),(TODAY()+60),TODAY()+90)))))
 
 
Here is some sample data:
dbockra_0-1663940663173.png-> forecast and actualsdbockra_1-1663940676715.png-> project number and deadline

 

 

 

HoangHugo
Solution Specialist
Solution Specialist

You use MAX[column], it will return only one value, so it lead to your formula = same value. I did not know your data, and purpose, so can not support detail.

Anonymous
Not applicable

Hello. I am providing more info in the comment above.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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