Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have report which is generated daily to CSV and then imported into SQL every day. The report has no date timestamp, so when the CSV is imported into SQL, it adds a datestamp column.
I want to show display the total count of servers for every Sunday.
01/01/2021: VMReport1
TimeStamp | VMName |
01/01/2021 | Machine1 |
01/02/2021: VMReport2
TimeStamp | VMName |
01/02/2021 | Machine1 |
01/02/2021 | Machine2 |
.
.
.
01/07/2021: VMReport7 has 23 VMNames
I want to show the total of VMNames for every 7th day of the week. For the example above, it should be 23. The Date Hierarchy in the Field section doesn't have Week as an option.
Hi @hatchda ,
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. Thank you.
Best Regards,
Eyelyn Qin
Hi @hatchda ,
According to my understanding, you want to calculate the distinct count of Machine of each Sunday,right?
You could firstly add a Week column and then use the following formula to calculate:
Week =
WEEKNUM ( [Date], 2 )
Count Column=
CALCULATE (
DISTINCTCOUNT ( 'Table'[VMReport] ),
FILTER ( 'Table', 'Table'[Week] = EARLIER ( 'Table'[Week] ) )
)
Or
Count Measure =
CALCULATE (
DISTINCTCOUNT ( 'Table'[VMReport] ),
FILTER ( ALL ( 'Table' ), 'Table'[Week] = MAX ( 'Table'[Week] ) )
)
The final output is shown below:
Please kindly take a look at the pbix file here.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@hatchda create a date table in your model and you should have a column in this called weekday, there are many posts on how to add one, here is one of my post, and then add a measure
Server Count on Sunday =
CALCULATE ( COUNTROWS ( Table ), KEEPFILTERS ( DateTable[Weekday] = "Sunday" ) )
On the bar chart, use date on the x-axis from the date table and above measure, it should work.
Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
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.
@hatchda you want to show the count of Sunday or Thursday? You have two different weekdays in your post.
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.
I would like to show the count for every Sunday because I would like have a graph that shows the Total Servers for each week.
Thanks,
David
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
98 | |
87 | |
35 | |
35 |
User | Count |
---|---|
152 | |
98 | |
81 | |
61 | |
55 |