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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
mzain90
New Member

Runing total by row

Hi,
i have seen this asked a few times but i have been unable to use this for my task

I have a column for Wind direction and one for timestamp as well as various other columns that are filtering out the data

I want a matrix like one below but the cells to contain the running total of the rows

 

I have tried the quick measure but cant seem to get it right

 

What it looks like:

 

Wind Direction                   Jan           Feb        Total

0                                           10             9              19

10                                           5             6              11

...

 

What im after

 

Wind Direction                   Jan           Feb        Total

0                                           10            19              19

10                                           5            11              11

...



sample: https://1drv.ms/u/s!AqgwstyhNHf8gsphsHZD3rVqVPMtQg?e=PWPRZs

(sample file is dummy data, will differ from the table typed above)

4 REPLIES 4
ryan_mayu
Super User
Super User

 

@mzain90 

pls provide the sample data

 





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

Proud to be a Super User!




Samarth_18
Community Champion
Community Champion

Hi @mzain90 

 

You can create a measure with below code:-

cumulative_total=
CALCULATE (
SUM ( 'table'[<values column>] ),
FILTER ( ALL ( 'table'[date] ), 'table'[date] <= MAX ( 'table'[date] ) )
)

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

i tried that as it does appear to be a popular solution but it doesnt seem to work for me.
ive uploaded a dummy power BI file here:
https://1drv.ms/u/s!AqgwstyhNHf8gsphsHZD3rVqVPMtQg?e=PWPRZs

@mzain90 

pls try this

 

Measure = CALCULATE(sum(test[Valid Data]),FILTER(test,'test'[WD (bins)]=max('test'[WD (bins)])&&'test'[Date]<=max('test'[Date])))

 

1.PNG

 

if you want the total to display the correct value , create another measure

Measure 2 = sumx(test,[Measure])




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

Proud to be a Super User!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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