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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Dynamically Re-calculate Calculated Column (work-around?)

From what I've gathered you can't re-calculate a calculated column based on something like a What-If parameter.

So I'm wondering if there's another solution for my problem.

 

I have a campaign table where I have a calculated colum for the total ROAS for each campaign. I have then created a number of ranges of different ROASs (0-1, 1-2, 2-5), and I also have a spend column. This way I can create a table and view how much has been spent on each ROAS range.

 

Here's the problem: 

I want to be able to slice this table in different years to view how much was spent on that ROAS range in that given year, but I want the year I select to re-calculate the ROAS ranges based on the performance of that given year. If I take my current tables and slice on a year, it will simply tell me what was spent on that ROAS range that year. But the ROAS range is in this case rigid so its taking the entirety of my data tables to calculate the ROAS ranges and then giving me the spend that was assorted to those ranges within the year I have selected.

 

I feel like I may need to tackle this differently but kinda stuck atm.

 

Thanks

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

It takes some more advanced DAX but you can do this.  You can create virtual tables with virtual columns in a measure; the columns can use those ranges in their calculation.  The ranges can be harvested from an ROA table, or be calculated dynamically based on another measure (max value, etc.); I couldn't tell from your post which scenario you have.  You can then do analysis on those virtual columns in that virtual table.

 

This blog shows an example - https://blog.enterprisedna.co/segment-your-customers-into-groups-advanced-dax-example/

 

If this works for you, please mark it as 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

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

It takes some more advanced DAX but you can do this.  You can create virtual tables with virtual columns in a measure; the columns can use those ranges in their calculation.  The ranges can be harvested from an ROA table, or be calculated dynamically based on another measure (max value, etc.); I couldn't tell from your post which scenario you have.  You can then do analysis on those virtual columns in that virtual table.

 

This blog shows an example - https://blog.enterprisedna.co/segment-your-customers-into-groups-advanced-dax-example/

 

If this works for you, please mark it as 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


Anonymous
Not applicable

Thanks!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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