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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
hatchda
Frequent Visitor

Display Weekly Total based on a report that is generated daily

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

TimeStampVMName
01/01/2021Machine1

 

01/02/2021: VMReport2

TimeStampVMName
01/02/2021Machine1
01/02/2021Machine2

.

.

.

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.

5 REPLIES 5
v-eqin-msft
Community Support
Community Support

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

v-eqin-msft
Community Support
Community Support

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:

1.15.4.1.PNG

 

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.

parry2k
Super User
Super User

@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.

parry2k
Super User
Super User

@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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors