Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello,
I have written a dax code. 
My aim is to count all the store number that has value greater than 0 as per the condition specified by the STORE variable. But I am not able to produce the retyurn statement
The DAX Code that I have written is as follows:
VAR _Reference_Date = MAX('Date'[Date])
I should get the Total 5 as these many store has Measure >1 but I am getting 7. I am also getting Total as 1 instead of 5. Please do help
Solved! Go to Solution.
Hi @Mkrishna ,
Please try:
RETURN SUMX(VALUES('Main Table'[Store Number]),IF(store>0,1,0))
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Try this 
Return CALCULATE(
IF(STORE > 0, 1, 0),
FILTER(Customers, STORE > 0)
)
Hi @Mkrishna ,
Please try:
RETURN SUMX(VALUES('Main Table'[Store Number]),IF(store>0,1,0))
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.