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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Rahulsingh
Helper I
Helper I

Date Measure and Calculated Column

Hi Everyone 

 

I have created a measure 

MeasureDate =  CALCULATE(MAX('Table1'[DateRec]),ALLSELECTED('Table1'))

 

When I try to use this measure in a Calculated column it does not work for the if statement

 

Column= IF('Table2'[DueDate]<[MeasureDate ],"Active","Paid")

 

Any help would be greatly appreciated

 

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Rahulsingh,

 

If Table1 is not related to Table2, measure [MeasureDate] will work like a static date value in IF statement.

 

Please try this:

MeasureDate =  CALCULATE(MAX('Table1'[DateRec]),ALL('Table1'))

Column= IF('Table2'[DueDate]<[MeasureDate ],"Active","Paid")

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Floriankx
Solution Sage
Solution Sage

Hello,

 

are the tables related?

If so, DAX applies measure to every row.

 

You could also try to dim your Measure inside your Column:

Column= 
VAR MeasureDate =  CALCULATE(MAX('Table1'[DateRec]),ALLSELECTED('Table1'))
RETURN IF('Table2'[DueDate]<[MeasureDate ],"Active","Paid")

Hi 

Column= 
VAR MeasureDate =  CALCULATE(MAX('Table1'[DateRec]),ALLSELECTED('Table1'))
RETURN IF('Table2'[DueDate]<[MeasureDate ],"Active","Paid")

Does not work me because it calculates measure date on each row but I want the measured date to be static  like 

eg 

IF('Table2'[DueDate]<"3/21/2018","Active","Paid")

 

hi Everyone, 

I have found the solution for this query as we cannot use a measure in our calculated columns, I had to think differently.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.