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
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
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.

Top Solution Authors