cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
nrohith Frequent Visitor
Frequent Visitor

Dax Help for two different tables

Hello,

 

I need help with the following. I have the following tables:

 

1. VAS Table with the following values for columns Date and Subject 

2. Sales Table with values for Date and Subject as well.

 

I want to group the VAS and Sales table by date and then subtract the count. For example:

 

VAS:

 

Date                Subject

1/21/2019       aaa

1/21/2019       bbb

1/22/2019       ccc

1/22/2019       ddd

1/22/2019       eee

1/22/2019       fff

 

Sales

 

Date                Subject

1/21/2019       aaa

1/22/2019       bbb

1/22/2019       ccc

 

I have created a date table with unique dates. I want to add a column in it from the previous two tables with the following:

 

Date              Count

1/21/2019      1 (subtracted from VAS - Sales for that date)

1/22/2019      2 (subtracted from VAS - Sales for that date)

 

Any help is appreciated!

 

Thank you! 

 

Neetu 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Dax Help for two different tables

Hi @nrohith

 

Try this for the column, where NewTable is the last table you show:

 

 

Count =
CALCULATE ( COUNT ( VAS[Date] ), FILTER ( VAS, VAS[Date] = NewTable[Date] ) )
    - CALCULATE ( COUNT ( Sales[Date] ), FILTER ( Sales, Sales[Date] = NewTable[Date] ))

 

1 REPLY 1
Super User
Super User

Re: Dax Help for two different tables

Hi @nrohith

 

Try this for the column, where NewTable is the last table you show:

 

 

Count =
CALCULATE ( COUNT ( VAS[Date] ), FILTER ( VAS, VAS[Date] = NewTable[Date] ) )
    - CALCULATE ( COUNT ( Sales[Date] ), FILTER ( Sales, Sales[Date] = NewTable[Date] ))

 

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 164 members 2,065 guests
Please welcome our newest community members: