Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Changlin
Frequent Visitor

Merged Table data not displaying data correctly in chart

Hi,

 

I have merged 2 tables A and B with left join in Power BI. Table A has 355 rows (Contains ID, Name columns) and Table B (Contains ID, State and Created Date columns) has thousands rows. I got merged table that I want with 355 rows (Contains ID, Name, State and Created Date columns). I need to display chart like the following picture in Power BI.

Changlin_0-1657727718998.png

 

But when I using Area chart to display the data:

Axis - Merged table Created Date 

Legend - Merged table State

Values - Merged table Sum of ID

I got the following chart

Changlin_1-1657727845381.png

The value is totally incorrect cuz my merged table should only have 355 rows. I tested and searched a lot but still can't fix this. I don't know why it shows record of table B but not the merged table.

 

Please help me!

 

Thanks,

 

Changlin

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Changlin ,

 

Please try:

Count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),[State]=MAX('Table'[State]) && [Date]<=MAX('Table'[Date])))

Output:

Eyelyn9_0-1658121635720.png

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Changlin ,

 

Please try:

Count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),[State]=MAX('Table'[State]) && [Date]<=MAX('Table'[Date])))

Output:

Eyelyn9_0-1658121635720.png

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Eyelyn,

 

Thanks for your answer, your query helps me solve the problem. I have marked you answer as solution.

 

Have a good day,

 

Changlin

parry2k
Super User
Super User

@Changlin very hard to tell, I guess you still have 355 rows in your main table, or has the number of rows increased? Can you share pbix file, and remove sensitive information before sharing. You can share using one drive/google drive.

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi parry2K,

 

Thanks for answering, I just found that the number is huge because it sums the ID (which is whole number), so that's a mistake. 

 

I made a simple template table as the following:

Changlin_0-1657736053904.png

The truly problem is how to count rows before each row Date for 2 different states.

For example:

Changlin_1-1657738935574.png

It should looks like this, can I build a query to get this count column?

 

Thanks,

 

Changlin 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.