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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
lboldrino
Resolver I
Resolver I

Sum Row by Row with sort Value over Col

lboldrino_0-1618301487709.png

i need  to calcute sum MSR count Tickets row by rows. 

0,5h = 326

1 h must be 326 + 227 = 526

how can i calcute sum my rows with order value as sort asc?  the table is sorted by value order

here is my measure, but this ignore my sort col "order"

 

MRS Running Total = 
var _ResolvesClsuter = [MSR count tickets]  

return 
sumx(filter(SUMMARIZE(allselected(fact_ticket_stats),dim_resolvetime_cluster[resolvetime_cluster_key],
"Tickets", [MSR count tickets]),
[Tickets] >= _ResolvesClsuter ),
[Tickets])

 

1 ACCEPTED SOLUTION

The formula below should work for your model.

 

MRS Running Total =
VAR currDisplayValue =
MAX ( 'dim_resolvetime_cluster'[Order] )
VAR result =
CALCULATE (
[MSR Count Tickets],
ALL ( 'dim_resolvetime_cluster' ),
'dim_resolvetime_cluster'[Order] <= currDisplayValue
)
RETURN
IF ( HASONEFILTER ( dim_resolvetime_cluster[Display] ), result, BLANK () )

 

View solution in original post

4 REPLIES 4

Hi

 

Its not clear what you underlying model looks like but I have assumed that your 'dim_resolvetime_cluster' table has a column for the order and that this is not a measure. the following measure should work for you once you update with the appropriate column and table names

 


MRS Running Total =
VAR currDisplayValue = MAX ( 'Fact_ticket_stats'[Order] )
VAR result =
CALCULATE (
SUM ( Fact_ticket_stats[MSR Count Tickets] ),
ALL ( 'Fact_ticket_stats' ),
'Fact_ticket_stats'[Order] <= currDisplayValue
)
RETURN
IF ( HASONEFILTER ( Fact_ticket_stats[Display] ), result, BLANK () )

 

order is not a measure but [MSR Count Tickets] is a measure. 

 

lboldrino_0-1618304715921.png

and Disply_name and order are in a dim_table and Tickets are in a fact_table (count of tickets )

lboldrino_1-1618305020225.png

 

The formula below should work for your model.

 

MRS Running Total =
VAR currDisplayValue =
MAX ( 'dim_resolvetime_cluster'[Order] )
VAR result =
CALCULATE (
[MSR Count Tickets],
ALL ( 'dim_resolvetime_cluster' ),
'dim_resolvetime_cluster'[Order] <= currDisplayValue
)
RETURN
IF ( HASONEFILTER ( dim_resolvetime_cluster[Display] ), result, BLANK () )

 

thanx 🙂

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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