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
MatthewJM
Frequent Visitor

Generate Mins and Maxes of Data Range (By category and week of year) to Utilize Error Bands

Hello!

 

I have a dataset that is very extensive with many categories (and some calculated measures), I would like to create a measure or a data table that will create mins and maxes of each category by week, over a set time period (say last 3 years). I have the data mapped to a date table and use it to create "seasonality" graphs that overlays data, each year being a line, and a different chart for each category. 

 

Then I would like to chart the most recent data as a line on a graph and overlay that with last 3 years average appearing as a shaded region on the graph. I think I can do this once I have a table of values. However, I calculate that in order to do this for my current dataset it would be 84 columns. Is there an easy way to do this or am I forced to brute force it? And if I have to brute force it, how can I use a measure in a column of a power query? 

 

Below is a sample data set to help the conversation. 

 

Thank you for your help!

CategoryWeek of YearYearValue
Category 1120225
Category 21202250
Category 1220221
Category 222022300
Category 1120212
Category 212021400
Category 1220218
Category 222021100
Category 1120207
Category 212020200
Category 1220203
Category 222020200

 

 

GoalCategory 1 MinCategory 1 MaxCategory 2 MinCategory 2 Max
Week127100300
Week21850400

 

 

4 REPLIES 4
MatthewJM
Frequent Visitor

Thank you for the response. 

I am getting the desired result when the page filters are wider than this year - 5 years. For some reason the page filters are still effecting the data, even when I utilize the all function to remove any filters from the data set and do all the filtering in the measure. 

MatthewJM_0-1703797096367.png

 

And yes I do have a date table that is separate from where my data lives, however I was just trying to mess around with different filters, neither filtering with the date filter nor with the data table works. 

 

Thanks!

 

I also tried to use the page filters to my advantage and use the allexcept function to remove all filters except those on the map descriptors table, and that solution was giving me the same desired result when greater than 5 years was selected, but not when only this year was selected. 

thanks,

v-zhangti
Community Support
Community Support

Hi, @MatthewJM 

 

You can try the following methods.

Max = CALCULATE(MAX('Table'[Value]),ALLEXCEPT('Table','Table'[Category],'Table'[Week of Year]))
Min = CALCULATE(MIN('Table'[Value]),ALLEXCEPT('Table','Table'[Category],'Table'[Week of Year]))

vzhangti_0-1703730192391.png

Is this the result you expect? If not, please provide your desired outcome.

 

Best Regards,

Community Support Team _Charlotte

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

MatthewJM
Frequent Visitor

MatthewJM_0-1703712730995.png

I would like the result to look like this. With the current data set being the only line on the graph, and use error bands to shade the region. 

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.