Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Greetings everyone. I have an alarmStatus column that contains "ON"/"OFF" and would like to count the sum of distinct text when i filter using the country. For example Nigeria, Owo,Amos fashanu will have a countrows equals to 4 (datetime = 2021-02-02)when the alarmStatus is ON and Rabiu Azeez will have count of zero (0) because it is OFF. How can i write a DAX to calculate that? The last Column is for the DieselFlowOver40 Count. Thanks
Desired Result
The data Tables
Solved! Go to Solution.
@Brighton10 update measure and then check
Count On =
CALCULATE ( COUNTROWS( Table ),
KEEPFILTERS(Table[AlarmCode] = "DieselFlowOver40"),
KEEPFILTERS(Table[AlarmStatus] = "On" )
) + 0
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.
@Brighton10 I just looked at the file and added the measure I provided previously, and I get the following result. What is the issue with it?
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.
Thanks @parry2k , thats correct and i added a date filter to that measure as well.
@Brighton10 yes that will be very helpful, I'm not seeing the full picture.
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.
@Brighton10 update measure and then check
Count On =
CALCULATE ( COUNTROWS( Table ),
KEEPFILTERS(Table[AlarmCode] = "DieselFlowOver40"),
KEEPFILTERS(Table[AlarmStatus] = "On" )
) + 0
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.
Its still the same, Let me share my pbix file and have a look from there
The file is under the DieselFlowOver40 folder https://drive.google.com/file/d/1cBlHHhmub1d9IEWWEG-mxmdHKika4gNb/view?usp=sharing
@Brighton10 you can change the measure as below and test it
Count On =
CALCULATE ( COUNTROWS( Table ), Table[AlarmCode] = "DieselFlowOver40", Table[AlarmStatus] = "On" ) + 0
do test the measure in the visual and if it doesn't work, come back with details, explaining what is not working and what are the expectations.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
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.
This measure works by counting the rows per country when its ON. When I include a region and Sitename filters its showing the sum value for all the sitenames. I want it to show on the specific sitename where it was ON, where it was OFF should be 0.
@Brighton10 not sure fully understood but add this measure and use it in visual and see if that gets you what you are looking for
Count On =
CALCULATE ( COUNTROWS( Table ), Table[AlarmStatus] = "On" ) + 0
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
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 your response. So basically I want to create a calculated measure/column to show the distinct count when alarmCode=DieselFlowOver40 per day. So when the alarmStatus is OFF the count should always equal zero and when ON we count the number of rows.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
42 | |
30 | |
27 | |
27 |