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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
inbal
Regular Visitor

dynamic variable to determine the distribution of data

Hi,

 

I would like to divide the lines in my data by numerical value.

I must save the value dynamically because the value changes every time rows are updated,

and then perform the partition.

 

Here is a small example:

 

Row number

Project

The value I want

001

Aaa

A

002

Bbb

A

003

Ccc

B

004

Ddd

B

005

Eee

B

 

When the project value is "Ccc" we would like to get the line number, say in this case “003”.

All rows above (1-2) will have a value of A And all the rows below (3-5) it will have a value of B.

 

How can I do this?

 

Thanks,

Inbal

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@inbal,

You can create the following columns in your table. Please change the data type of Index column to whole number.

Index = Table[Row number]
number of Ccc = CALCULATE(FIRSTNONBLANK(Table2[Index],1),FILTER(Table2,Table2[Project]="Ccc"))
The value I want = IF(Table2[Index]<Table2[number of Ccc],"A","B")

0.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

@inbal,

You can create the following columns in your table. Please change the data type of Index column to whole number.

Index = Table[Row number]
number of Ccc = CALCULATE(FIRSTNONBLANK(Table2[Index],1),FILTER(Table2,Table2[Project]="Ccc"))
The value I want = IF(Table2[Index]<Table2[number of Ccc],"A","B")

0.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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