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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PBE
Helper II
Helper II

Row formulas in Table

Hi, in my previous post I found out how to allocate a row number for each row in table. There will be a maximum of 30 rows.

Is it possible to allocate a different formula to a different row?

Something like this...

PBE_0-1688741270715.png

Any questions let me know.

 

Thanks for help

 

3 REPLIES 3
Greg_Deckler
Super User
Super User

@PBE Well, more or less that is what the pattern in the article is doing. Essentially you are adding a column to the table for each recursive iteration. By doing this, you effectively avoid recursion within a single column which DAX does not like, it just makes it a complete pain to code and requires a reasonable maximum approach. Could it also be done as 30 measures instead of 30 columns in a table. Sure. But I'm not sure that is really any better and would likely be more of a pain to manage since the code would be split between 30 measures versus all in a single measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@PBE So most likely not, at least not in any acceptable form that you are probably going to want to deal with. Although, with 30 rows maximum it could, in theory, be possible. The reason is that there is a recursive element to this code for Backfill and DAX hates recursion with a passion. Previous Value (“Recursion”) in DAX - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thanks again @Greg_Deckler for your help. Is it possible I could calculate the answer separate from a table. I'm guessing here, perhaps allocate RN1 Work, RN1 Service and RN1 Backfill as the variables and the same for RN 2 work etc. Then use these variables to calculate the answer for each row.

 

Such as Formula 1 = RN1 Work - RN1 Service = answer 1

Formula 2 = RN2 Work - (RN1 Service + RN2 Service) = answer 2

 

Then say display answer 1 in card 1 and answer 2 in card 2 etc.

 

The part I definitely don't know is how to make RN1 Work and RN 1 Service into variables and use these in a formula.

 

Any ideas?

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.