## Desktop

Highlighted
Regular Visitor
Posts: 42
Registered: ‎04-02-2017

# MIN from four different tables

Hi I need a DAX formula to calculate min value (time in this ex) from four different columns that are in different tables.

The problem is when the MIN measure returns blank, so simple min(min ();min()) is not working. Please help!

Accepted Solutions
Super Contributor
Posts: 3,697
Registered: ‎07-17-2016

## Re: MIN from four different tables

Hi @blazko,

Based on my test, the formula should work in your scenario.

```Measure =
MAXX (
UNION (
SELECTCOLUMNS ( Table1, "Date", Table1[Date1] ),
SELECTCOLUMNS ( Table2, "Date", Table2[Date2] ),
SELECTCOLUMNS ( Table3, "Date", Table3[Date3] ),
SELECTCOLUMNS ( Table4, "Date", Table4[Date4] )
),
[Date]
)
```

Remark: just replace the bold with your real table name and column name.

Regards

All Replies
Super Contributor
Posts: 3,697
Registered: ‎07-17-2016

## Re: MIN from four different tables

Hi @blazko,

Based on my test, the formula should work in your scenario.

```Measure =
MAXX (
UNION (
SELECTCOLUMNS ( Table1, "Date", Table1[Date1] ),
SELECTCOLUMNS ( Table2, "Date", Table2[Date2] ),
SELECTCOLUMNS ( Table3, "Date", Table3[Date3] ),
SELECTCOLUMNS ( Table4, "Date", Table4[Date4] )
),
[Date]
)
```

Remark: just replace the bold with your real table name and column name.

Regards

Regular Visitor
Posts: 42
Registered: ‎04-02-2017

Thank You!