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

Basic Question on DAX Model

I have 2 Tables with Data as follows

TEST1

A     5

B     10

 

TEST2

A    P1

A    P2

A    P3

B    P4

B    P5

 

I pulled all the Columns to a Table on Desktop and got below Results - 

 

A    P1   5

A    P2   5

A    P3   5

B    P4   10

B    P5   10

-------------

             15

 

Total Row being 15 ... What I expected is to join TEST1 table with TEST2 and then sum the Numeric field but instead of the Total being 35 it is still 15. How does the DAX evaluate for this Scenario ???

4 REPLIES 4
Phil_Seamark Super Contributor
Super Contributor

Re: Basic Question on DAX Model

Hi @srikanthguna

 

How have you created the bottom table?  Have you just created a relationship between the two tables?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

srikanthguna Frequent Visitor
Frequent Visitor

Re: Basic Question on DAX Model

Created those Tables manually and a relationship was also established between the first Column of both the tables. Test1 to Test2 ( one to many relationship)
Super User
Super User

Re: Basic Question on DAX Model

Hi,

 

Using the Query Editor, you should first merge both Tables into one (joining based on the first column) and then write a simple measure

 

=SUM(Merged Table[Amount])

 

Hope this helps.

srikanthguna Frequent Visitor
Frequent Visitor

Re: Basic Question on DAX Model

Hi Ashish,

 

I am just trying to understand how the DAX is computing a Total of 15 instead of 35 when you try to pull all the Columns from both the Tables.

 

Thanks Ashish & Phil for responding to this Topic. 

 

Here is what I am visualizing in SQL World - 

SELECT SUM(TEST1.Column2) FROM (SELECT * FROM TEST1 INNER JOIN TEST2 ON TEST1.Column1 = TEST2.Column1) A

 

But I think the SUM is still 15.

Helpful resources

Announcements
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

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: 102 members 1,538 guests
Please welcome our newest community members: