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] ))

 

View solution in original post

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] ))

 

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 55 members 1,202 guests
Please welcome our newest community members: