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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
vinayguptak81
Frequent Visitor

DAX Count not working

Hi everyone,

I am running into an issue and need some guidance.

Situation:  I have a handful of stores that I would like to count based on the Invoice Date selected, but excluded if they were closed.

For example:

vinayguptak81_4-1684357667398.png

The Active Store in Table 1 is coming from Table 2, but it brings up all the stores.  So what I am trying to achieve is, if I selected Invoice dates: 05/2023 - 03/2023, then the Active store counts should be YearMonth >= 03/2023 === 262, not 367.

 

Any help is highly appreciated.  Thank you.

 

 

5 REPLIES 5
v-jianboli-msft
Community Support
Community Support

Hi @vinayguptak81 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

Wilson_
Super User
Super User

Hi Vinay,

 

What does your data model look like?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi Wilson,

Table 1 is detail and Table 2 is roll-up.  The relationship between the two tables is Entity join.

Vinay,

 

It sounds like at the very least you would benefit from a dates/calendar table (and perhaps from an entity dimension table). Not the quick fix you were perhaps looking for but it soudns like you would benefit long term from learning about data modeling; a proper data model would make this easier to build than having to overcomplicate the DAX. SQLBI is a phenomenal resource and they have a free intro to data modeling course available.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi Wilson,

Thanks for the suggestion. I'll take a look at it.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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