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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Not showing data properly

I'm new to Power BI, but I've used other BI solutions in the market.

 

Anyway, I have a situation where I can't seem to work out. I've made a simplyfied example so someone can understand and help me. I've got two tables, one with purchase information such as date of purchase and unit price:purchase tablepurchase table

 

The second table contains information of how many products were bought and expected day of arrival to the costumer:

date of arrival tabledate of arrival table

 

I tried to make a simple Matrix with these informations, this is what happens:

matrixmatrix

 

As you can see, when there is no product for that respective date of arrival, it appears as blank. But, somehow, the unit price is considered in the Total. Also I've done measure called Total price:

 

 

 

 

 

 

Total price = COUNT('Date of arrival'[ID])*SUM(Purchases[Unit Price])

 

 

 

 

 

 

Take the date 01/03/2020: there are 2 products with the value of $100 each and there is a product with the value of $250. The total calculation uses the total sum of unit price and multiply with total count of products sold. So the calculation made is 100+250+50 = 400 (the 50 shouldn't be considered), take this value ans multiply with the total count of products giving: 400*3 = 1200. And I was expecting to calculate like this 2*100 + 1*250 = 450.

 

For me, this results are weird since I defined the relations between the data. 

relation.png

 

If someone can help me, I'll be very grateful.

3 REPLIES 3
dax
Community Support
Community Support

Hi @Anonymous , 

I am not clear about your requirement, if possible could you please inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

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

amitchandak
Super User
Super User

Either you have move price from one table another like these example

New Column = maxx(filter(table2,table2[Col1]= table1[col1] && table2[Col2]= table1[col2] ),table2[required_col])
New Column = maxx(filter(table1,table1[Col1]= earlier(table1[col1]) && table1[Col1]= earlier(table1[col2]) ),table1[required_col])

 

Or group data at purchase ID

Something like this

sumx(summarize(Purchase[Purchase ID], "_sum", count(ID), "_price",max([price])),[_sum]*[_price])

 

But Purchase ID should be in common dim or taken from the master table

 

Refer : https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...

Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors