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
Mahadi
Frequent Visitor

Value count problem

Hello good people, I am a new Power BI learner and have encountered a problem while designing a data model. I have attached the file where I am working on ContosoDW. You can see the values are the same. I need your experienced opinion. I will be very greatful if you are able to point out the exact problem in the table connection. Thank you.   https://drive.google.com/file/d/1U-O8ctnBOkIb8E3-16IJ_uQQF8wAX3SB/view?usp=sharing 

 

Capture.PNG

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

@Mahadi okay, all you need to do is add a new column in the DimProduct table like below and then use the YEAR from the DimProduct table instead of the Date table.  Keep the Count of ProductName the same.

 

TheoC_2-1645754169659.png

 

 

Hope this helps!

 

Theo 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

7 REPLIES 7
TheoC
Super User
Super User

@Mahadi okay, all you need to do is add a new column in the DimProduct table like below and then use the YEAR from the DimProduct table instead of the Date table.  Keep the Count of ProductName the same.

 

TheoC_2-1645754169659.png

 

 

Hope this helps!

 

Theo 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Ashish_Mathur
Super User
Super User

Hi,

What are you trying to accomplish by dragging Product Name to your visual?  If you wan to know how many products are available for sale, then create a relationship from the AvailableForSaleDate column of the Products Table to the Date column of the DimDate Table - you will have to modify other relationships before you create this new relationship.

So please clarify what exactly do you want to accomplish.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
HotChilli
Super User
Super User

Hi @Mahadi @TheoC ,

I hope I'm not stepping on any toes but I thought I'd respond since Theo is answering from his phone.

 

The visual created has 2 fields from dimension tables (which is unusual) and if you look at the data model and  the relationship directions, they are 1:many from the dimension tables to the FactSales table.

i.e. date table ->FactSales <- product table so the date table doesn't know anything about the product table unless something from the FactSales table is involved.  A typical symptom of this sort of thing is when all the aggregation values for different dimension values are the same.

Dimension tables are used to slice and dice data from a fact table so in this instance you will need to decide what you actually want in the visual, for example, Calendar Year from the date table and count/distinct count of product ID from the FactSales table.

---

There's quite a lot to grasp here so I hope it makes sense.

Good luck in your powerbi journey. 

Mahadi
Frequent Visitor

Capture.PNG 

Hi @TheoC , it didn't work. I cannot figure out what's the problem actually. 

Hi @Mahadi,

 

Certainly take a look at what @HotChilli has provided. It makes a lot of sense. I'd recommend following their approach to correcting the data model.

 

If you need more information on what @HotChilli has provided, make sure to comment and ask them. The Super Users and Community members are pretty amazing people!

 

All the best and look forward to you getting a solution for your current issue.

 

@HotChilli Thanks heaps for helping out!

 

Cheers guys!

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

TheoC
Super User
Super User

Hi @Mahadi 

 

Can you use this measure and let me know if it works:

 

Measure = COUNTROWS ( Table )

 

Then drag it to the table visual? Apologies, on phone so can't download file.

 

hope this helps.

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@Mahadi okay, all you need to do is add a new column in the DimProduct table like below and then use the YEAR from the DimProduct table instead of the Date table.  Keep the Count of ProductName the same.

 

TheoC_0-1645742499860.png

 

Hope this helps!

 

Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

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.