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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
hejszyszky
Helper II
Helper II

Script to add column based on historical data

Hi,

I've been trying to add automatic column with py script, but without a success. So the idea is to lets say i have a table like below:

 

 

Default TableDefault Table

 

 

And the idea is to create a additional column which tells us a current situation of A or B value over time, so basically something like this: ( let's say that 7-th month data is updated)

 

Table with new columnTable with new column

 

 

 

Did anyone took similar approach to something like above? Looking for a suggestions & approach ideas or some solutions to problem above. A & B columns could also be like A (as value) and B as value category.


Thanks in advance!!

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

AlexisOlson
Super User
Super User

You could do something like this with a measure incorporating a bunch of if/then logic specifying what you want to say in any conceivable situation but that seems pretty painful to write and not nearly as useful as showing a visual instead.

Obviously, but in my case there is a need to have tooltip/comments in addition to graph. My idea was to loop through dates and output value progression over time but as mentioned above - ended up without success.
Nested ifs are painful - i agree, but i consider it as last resort.
Thanks for your reply!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.