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
Anonymous
Not applicable

Biweekly GroupBy onto linegraph's x-axis

Hello everyone, I am fairly new to Power BI and am trying to do something which seems relatively easy to accomplish, but I have been struggling with.

I want to aggregate data biweekly and display it on an a graph as the x axis, with the other data showing up on the y axis. Essentially the graph's first point would be (end of two week period , sumof all data values between the period start and end) as (x,y). What would be the best way to acheive this?

 

Thank you for your time!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello, I wanted to follow up on this, I managed to find the solution. You are actually able to use dashboard features to perform "binning" which will create the desired result on my end. Posting this for those with similar problems. Goodluck!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hello, I wanted to follow up on this, I managed to find the solution. You are actually able to use dashboard features to perform "binning" which will create the desired result on my end. Posting this for those with similar problems. Goodluck!

Anonymous
Not applicable

Hello @v-jianboli-msft , thank you for taking the time to respond to my post! I really appreciate it.

That is not quite what I am trying to achieve, for which I apologize as I could have been more clear with my request. I will clarify my question, I hope you have the time to answer. 

 

Your simple sample is correct, in my situation I have my date and weeknum table in a "date table" and my values coming in from another table. (Not sure if that changes anything, but want to put it out there just in case)

As for the graph, it seems that the first data point would be in week one, which is not what I am trying to achieve. I essentially am trying to get the sum of all values in week 1 and 2, and plot that as the first point in my graph. For the next point in my graph, I want it to be the sum of all values in week 3 and 4, and have that as the next point in my graph. If we consider these two week intervals to be a unit, the graph would display them as unit1, unit2 on the x axis, and the sum on the y axis. 

I hope this clarifies everything! Thanks again for your time.

v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1680490964307.png

Then apply the measure:

Measure = 
var _a = SELECTEDVALUE('Table'[Week])
var _b = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Week]>=_a&&[Week]<=_a+1))
var _c = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Week]>=_a-1&&[Week]<=_a))
return IF(ISODD(_a),_b,_c)

Final output:

vjianbolimsft_1-1680491316499.png

Best Regards,

Jianbo Li

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

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.