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

Matrix: rows counter and cumulative total

Hi experts,

i have a matrix with 3 dimensions and some measures.

i want to add two new value but in this moment i can't find a solution for them.

 

The first one is a simply counter of the rows that it should be always start from 1, something like this:

RowsCounter.jpg

I have done it with the RANKX function but it always depend by the value and the dimensions.. i want only a counter.

 

The second one is the running total of the value "Valore" which is simply a sum of a value (SUM(Dati[Valore])).

Also in this case the sum will be dynamic and will be depending by the dimension you are looking for and by the sorting of the table.

 

Are those possibile?

 

Thank's

7 REPLIES 7
v-yuezhe-msft
Employee
Employee

@simonefraquelli,

Could you please share sample data of your table and post expected result of your second requirement?

I create row counter column using DAX below in the following sample table.

Row counter = RANKX(FILTER(Table1,Table1[Type]=EARLIER(Table1[Type])),Table1[Value],,DESC,Dense)

1.JPG2.JPG

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.

Hi Lydia,

thank's, but this is not the solution for me.

 

In my dataset i have a table which contains the data and the quantity/value filed, it's something like this:

11.JPG

 

In this case the trick with RANKX function doesn't work because he always depend by a dimension, i need just a simply ascending counter of the rows in the table, is there the possibility to do it?

@simonefraquelli,

In your sample table, you can directly add an idex column.
1.JPG

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.

@v-yuezhe-msft

 

Yes, i know it, but i don't need a row counter of the data table, i need a row counter of the visual matrix table that it should work like a normal measure.

Is this possibile?

 

11.jpg

 

Thank's

@simonefraquelli,

How do you create Matrix visual using the sample table named Data?

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.

@v-yuezhe-msft

 

Why?

The Data table is only a small example about my real one table.

 

Anyway the matrix is created with the dimensions in the table and some measure based on the quantity/value fields.

 

@simonefraquelli,

1.JPG


Create the following measure in your fact table.

Row counter= RANKX(ALLSELECTED('Table'[Agente]), [Valore],,DESC,Skip)

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.

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.