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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
Community Champion
Community Champion

@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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@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!:
DAX For Humans

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors