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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Automated table after value check

Hi community, this is a though one:

 

Capture.JPG

 

 

I have this table composed by the departure day, some markets and the values which are a daily average of some figures.

The departure date range starts spans over 80 days (6 months) with variable start days (generally it takes from the day of update +60 (initial day) + 180 (final date of report).

 

As we need to update a platform we have to make sure that dayily average is above 4 so the model can create a table where that looks like this:

 

Capture 2.JPG

 

where the 2 yellow fields are a range established after checking that the average figure is more than 4. So for example if for a day or more that figure is below 4, it should create a break and add a line. The other fields are populated from other queries. 

 

I could do somehting like this on excel but was a bit of an headache, hope we can work it out on PBI.

 

Thank you for your great support

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

You want to generate the below table based on the above one, right? To help us better understand your requirement, please make the logic of calculation more clear.

 

Based on my assumption, the first data table is dynamic. The highlighted data range is the expected result, which means in this period, the daily average is always over 4. In other words, each day has more than 4. But, if on one day, the average is below 4, the continual dates is broken. Then, it should be recalculate on next start day where the average is over 4 again.

1.PNG

 

If I get your requirement, please show us a more detailed image of your desired output, based on above sample data.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Yuliana, 

 

yes basically your assumption is correct. 

the table that you reported in your post is the result. 

 

In my mind the way this has to work is a bit long (and klunky)  as I should establish 180 if statements to make sure if the value is >4 and with another statement makes the date range.

 

And even more complicated in makes as many lines according to the number of date ranges found. 

 

In excel a nice macro would make this happen. don't know here >X

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.