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
Anonymous
Not applicable

Running Total measure/Column on multiple unsorted columns

I need help in creating a measure which can calculate running total for selected data in a table with unsorted columns as multiple group by are involved.
Business requirement is to have oil at the top always which is mostly positive value to start by and then calculte the running total for all other columns. It use to work early in SSRS(oracle as a source) using over parition by and order by the columns.Query was -

SUM(quantity) over (partition by item,place,Plan order by date,item,place, decode(item_type, 'Oil', 1,99), order_number,order_line)

In power bi i need to do it interactively and always it will be having a single item and place but multiple dates, item_types,order numbers and order_lines.
Currently my formula is giving duplicate while item type is same ,my Formula is:

amkumar_0-1596124358864.png
Please help me in creating a measure  to achieve this. Do let me know if you need more details
Thanks
Amit
Item PlaceDateItem TypeORDER_NUMBEROrder LineovalQuantityr total1Expected Output
78801America7/8/2020Oil 111199390199390199390
78801America7/9/2020FoodMaterial123-15240184150184150
78801America7/10/2020Sports1376131474800188950188950
78801America7/11/2020Sports demand103674158-1590184531187360
78801America7/12/2020Sports demand103695118-3184531187357
78801America7/13/2020Sports demand106984328-2420184531184937
78801America7/14/2020Sports demand137634348-89184531184848
78801America7/15/2020Sports demand137635218-89184531184759
78801America7/16/2020Sports demand1376361018-89184531184670
78801America7/17/2020Sports demand1376371138-89184531184581
78801America7/18/2020Sports demand82435354328-50184531184531
78801America7/19/2020Sports1376141074800193750189331
78801America7/20/2020Sports demand82195121328-633183758188698
78801America7/21/2020Sports demand103675458-2394183758186304
78801America7/22/2020Sports demand10369668-2183758186302
78801America7/23/2020Sports demand10698588-276183758186026
78801America7/24/2020Sports demand137638458-143183758185883
78801America7/25/2020Sports demand1376393438-143183758185740
78801America7/26/2020Sports demand137640458-143183758185597
78801America7/27/2020Sports demand137641658-143183758185454
78801America7/28/2020Sports demand137642458-143183758185311
78801America7/29/2020Sports demand137643338-143183758185168
78801America7/30/2020Sports demand82435355458-235183758184933
78801America7/31/2020Sports demand82435356908-235183758184698
78801America8/1/2020Sports demand8243535798-235183758184463
78801America8/2/2020Sports demand82435358458-235183758184228
78801America8/3/2020Sports demand82435359898-235183758183993
78801America8/4/2020Sports demand82435360458-235183758183758


2 REPLIES 2
Greg_Deckler
Super User
Super User

@Anonymous - Is the data posted source data or expected output. Whichever one it is, post the other as well please.

 

Please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Changed the data, i need to go from r total to expected output 

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