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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ratercero
Helper III
Helper III

Show if machine active on date//week/month measure

Hello, 

I have a list of transactions per machine and date, Im looking for a measure that returns the amount of machines activated filtered by date or week. 

I tried this but returns the amount of times a machines was active on a day :

 

MACH_DAY_COUNT = CALCULATE(COUNTA(t_Batch[c_MachineId]),t_Batch[ASSIGNED_DATE])

How can I count just once per machine and date?

 

Thank you

1 ACCEPTED SOLUTION

@parry2k 

 

I used:

 

MACH_COUNT = DISTINCTCOUNT(t_Batch[c_MachineId]) 

and works but partially, because some times we stop one machine and start another one, so when we look at the week shows we have more machines in a week than we have daily: 



Capture.JPG

 

 

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

You should add a calendar table and set relationship with your data and then use field from your calendar table (like week, date, year , month) to get desired output.

 

There are lots of posts around it, and here is quick link to get started on how to create calendar table in  powerbi



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.

Hello @parry2k,

 

I already have a date table, the issue is counting each machine once per day, even if the timeline visual is filtered by day/week or month.

if you have sugestions for the calculation I will apreciate.
Thank you

Did you put machine id on legend?


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.

@parry2k, I do not understand your question. please elaborate.

 

RT

May be I was not clear in my input, can you share screen shot of current graph/report and it will help to guide you.



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.

@parry2k 

 

I used:

 

MACH_COUNT = DISTINCTCOUNT(t_Batch[c_MachineId]) 

and works but partially, because some times we stop one machine and start another one, so when we look at the week shows we have more machines in a week than we have daily: 



Capture.JPG

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.