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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
whulsbergen
Helper II
Helper II

running total using count?

I'm trying to recreate this risk matrix from excel

whulsbergen_0-1594795648512.png

To do so, I need to offset coordinates based on how many points there are. In excel I use this:

whulsbergen_1-1594795740097.png

 

And then I need to count the coordinates. So for example:

itemxyxycount_xy
item 123231
item 213131
item 344441
item 444442

 

In the report I filter by date, so if possible, I want the count to be a dynamic measyre. How do I do this?

 

I tried running totals, but that doesn't work for items like it does for dates:

 

count_xy = calculate (count(xy);filter (allselected(xy);count(xy)<= count(???)(xy)))

7 REPLIES 7
harshnathani
Community Champion
Community Champion

Hi @whulsbergen ,

 

You will need to create an index column for Item

 

Then You can use this measure

 

RT =
VAR CurrentItem =
    SELECTEDVALUE ( 'Table'[Index No] )
RETURN
    CALCULATE (
        COUNT ( 'Table'[XY] ),
        'Table'[Index No] <= CurrentItem,
        ALL ( 'Table'[Index No] )
    )

 

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

Sorry @harshnathani , didn't work.

 

RT =
VAR CurrentItem =
SELECTEDVALUE ( RM_risicodata[XY_index])
RETURN
CALCULATE (
COUNT ( RM_risicodata[XY_index]);
RM_risicodata[XY_index] <= CurrentItem;
ALL( RM_risicodata[XY_index])
)
 
Result:
 

Schermafbeelding 2020-07-15 om 14.09.13.png

 

 

 

 

 

 

 

 

 

 

As you can see, the RT just shows "1". And with XY = 33, there should have been a 2 at RiskID 97.

Hi @whulsbergen ,

 

Please share some Sample Data in text format .

 

Also can you share the expected output.

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Risk_IDXYXYXY_indexexpected
98242451
102323281
95333391
97333392
993434101
1005454171
1035454172
965454173

 

Like this @harshnathani ?

The last column is what I expect.

 

FYI:

I need this to offset the coordinates in the next step so they show up seperately in a bubble diagram in stead of stacked.

RISKID 100: x= 5-0,2=4,8. y=4 + 0,2 = 4,2

RISKID 103: x= 5-0,2=4,8. y=4 - 0,2 = 3,8

RISKID 96: x= 5+0,2=5,2. y=4 + 0,2 = 4,2

Hi @whulsbergen ,

 

 

You can create a NewColumn

 

Column = RANKX(FILTER('Table','Table'[XY_index] = EARLIER('Table'[XY_index])),'Table'[XY]+'Table'[Risk_ID],,ASC)

 

 

Regards,

Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

Thanks @harshnathani for your help so far. I like your thinking, but I need to give it some more time. From what I can understand you regard the XY_index like it is a date. But that is not the case, it would be more like counting the unique index-numbers against the total number of that index-number in a column.

 

And I need it to be flexible, as I have various dates in the table and want to be able to filter without leaving holes in the bubble matrix.

 

 

Hi @whulsbergen ,

 

Can you pls share enough sample data and the expected output.

 

What I could understand from the data which was shared that you needed a running count based on XY_index column.

 

 

Regards,

Harsh Nathani

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors