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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
diogobraga2
Helper IV
Helper IV

Create measure or table with weekly trends from a dataset with daily snapshot

I need to create a weekly (every Monday) trend visual from a dataset with daily snapshots. I am wondering if it is best to create a measure or a table with weekly snapshots since there will be multiple measures that have daily snapshot, but will be displayed in weekly trends. 

 

Sample pbix 

 

 

2020-08-06_16-41-36.png

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Have you tried to wrap your measure(s) in an IF to get your desired result?  For example, using the Date column used in your visual -

 

Just Mondays = IF(WEEKDAY(MIN(Table[DateColumn]))=1, [YourMeasure])

 

This will return blank and get filtered out from the visuals on all days except Monday.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
mahoneypat
Employee
Employee

Have you tried to wrap your measure(s) in an IF to get your desired result?  For example, using the Date column used in your visual -

 

Just Mondays = IF(WEEKDAY(MIN(Table[DateColumn]))=1, [YourMeasure])

 

This will return blank and get filtered out from the visuals on all days except Monday.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thanks! The measure had to be aggregated for it to work.

 

Just Mondays = IF(WEEKDAY(MIN('Dates Adj'[Date]))=1, sum([Total Returning]))
 
🙂
Icey
Community Support
Community Support

Hi @diogobraga2 ,

 

My understanding is this:

 

You want to show weeks data in the visual.

 

If my understanding is wrong, please let me know. And I hope you can provide a more detailed description, preferably in the form of icons or screenshots, thanks.

 

If my understanding is right, try this:

 

1. Use unpivot in the Power Query Editor. Select the School Code and Date columns and Click Unpivot Other Columns.

unpivot.png

unpivot2.png

 

2. Create a calculated column in your Dates Adj table which is to calculate the number of weeks. The 2 in the WEEKNUM function means week begins on Monday.

Week Number1 = FORMAT(WEEKNUM([Date],2),"00")

weeknum.png

 

3. You can put them in the matrix. The result is as below. It shows weekly data changes.

week.png

 

You can check more details from here.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @Icey !

 

Your result is summing each week's values per attribute, that's not the desired outcome. The goal is to extract the data from each Monday as a representation of the week's total. The values inside the yellow boxes would represent the first and second weeks in the weekly trend visual. 

 

2020-08-07_08-03-10.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.