Forum Discussion

muzamir's avatar
muzamir
New Member
8 years ago

Inconsistent result in Power BI when comparing with mysql query

Hi guys,

 

I pull my data into Power BI desktop from AWS RDS. Honestly have been doing this for quite sometime but I have never experienced this. I need suggestions on how I can troubleshoot this.

 

I tried to upload images but i couldn't figure that out.

I have 4 tables.

1. users

2. studentprofiles

3.subjects

4. categories

 

On MySQL, I have written as such..

select count(u.id) from users u
inner join studentprofiles stu on u.id = stu.user_id
inner join subjects s on s.id = stu.subject_id
inner join categories c on c.id = s.category_id
where s.category_id = 10

which returns me 995

 

It was the same if i replaced this with a "where clause"

 

However, when I modelled this on Power BI, connecting them based on their respective IDs like the one above and set it on both cross filter direction. I am returned with the value 765.

My filters for Category_id are the same too.

 

Any suggestions?

2 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi muzamir,

     

    What about the returned result if you load all tables into desktop, then, inner join and filter them in Query Editor mode? Please try to connect to MySQL database from other applications such as Excel to see if problem persists.

     

    Regards,

    Yuliana Gu

    • muzamir's avatar
      muzamir
      New Member

      v-yulgu-msft As you mentioned, if i understand correctly. Under Edit Queries >> Merge Queries.

      Here I do an inner join for the respective tables to their respective IDs.. and filter in Query Editor mode. Just on a basic filter of selecting on category_id=10. The result is different for both mysql query and power bi.

       

      I am not too sure how to do data modelling on Excel. I attempted this but it was not interacting with the changes to the filter even after managing the relationship