cancel
Showing results for
Did you mean:
Highlighted
Anonymous
Not applicable

## Dax - Related - Help

Hi,

I have a holiday table which has

Date                           Number

01/01/2016                1

02/01/2016                2

etc and in my fact table I have

TDD Date

Basically I am wanting a column/measure in my fact table that gets the number for todays date and minus the TDD Number.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super Contributor

## Re: Dax - Related - Help

Hi @Anonymous,

Did you mean this?

Measure:

Minus Value =
VAR TDDNum =
CALCULATE (
MAX ( Holiday[ID] ),
FILTER ( Holiday, Holiday[Date] = MAX ( 'Fact'[TDD Date] ) )
)
VAR TodayNum =
CALCULATE ( MAX ( Holiday[ID] ), Holiday[Date] = TODAY () )
RETURN
TDDNum - TodayNum

Thanks,
Xi Jin.

3 REPLIES 3
Super Contributor

## Re: Dax - Related - Help

Hi @Anonymous,

First what are today's number and the TDD number? What's the relationship between holiday table and fact table? And what's the logic to make today's number minus the TDD number?

Thanks,
Xi Jin.

Anonymous
Not applicable

## Re: Dax - Related - Help

Holiday Table

Date                  ID

01/01/2001        2

02/01/2001        3

19/04/2018        500

Fact Table

TDD Date

01/01/2001

I am joining the two tables on date and I am wanting to get the related ID for tdd date and minus that from todays date ID

Thanks

Super Contributor

## Re: Dax - Related - Help

Hi @Anonymous,

Did you mean this?

Measure:

Minus Value =
VAR TDDNum =
CALCULATE (
MAX ( Holiday[ID] ),
FILTER ( Holiday, Holiday[Date] = MAX ( 'Fact'[TDD Date] ) )
)
VAR TodayNum =
CALCULATE ( MAX ( Holiday[ID] ), Holiday[Date] = TODAY () )
RETURN
TDDNum - TodayNum

Thanks,
Xi Jin.

Announcements

Kudos to you if you earned one of these! Check your inbox for a notification.

#### Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

#### Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,463)