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.
Hello,
I am trying to get two running totals as example below.
First one is for the toral up to yesterday (Today-1)
Second one is for the total on&after today.
I tried these DAX...but doesnt work.
Running total 1 :=
CALCULATE (
[Total Sales],
FILTER (
ALL ( DimDate[Datekey] ),
DimDate[Datekey] < Today( ( DimDate[Datekey] ) )
)
)
Running total 2 :=
CALCULATE (
[Total Sales],
FILTER (
ALL ( DimDate[Datekey] ),
DimDate[Datekey] >= Today( ( DimDate[Datekey] ) )
)
)
Any help would be greatly appreciated!
Solved! Go to Solution.
@topazz11 there are few ways to do this, here is one, add following measures
Upto Today = CALCULATE( [Sum Item1], FILTER( ALL( 'Date'[Date1] ), 'Date'[Date1] <= MAX( 'Date'[Date1] )) ) * IF( MAX( 'Date'[Date1] ) < TODAY(), 1 ) From Today = CALCULATE( SUM( 'Table'[Item2] ), FILTER( ALL( 'Date'[Date1] ), 'Date'[Date1] <= MAX( 'Date'[Date1] ) && 'Date'[Date1] >= TODAY() ))* DIVIDE( [Sum Item2], [Sum Item2])
sum item1 and sum item 2 measures are just sum of respectice columns
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Have you tried the built-in running total quick measures? Also, See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
How could this be achieved in POwer Query(performance will be affected)? calculate the cumulative total for a Purchase Oder until it reaches its maximum date.
123 1.2.2022 5units cumulative 5units
123 3.2.2022 2units cumulative 7units
123 5.2.2022 6units cumulative 13units
How could I achieve th ecumulative total in a column in POwer query?
Thank you
Have you tried the built-in running total quick measures? Also, See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
@topazz11 there are few ways to do this, here is one, add following measures
Upto Today = CALCULATE( [Sum Item1], FILTER( ALL( 'Date'[Date1] ), 'Date'[Date1] <= MAX( 'Date'[Date1] )) ) * IF( MAX( 'Date'[Date1] ) < TODAY(), 1 ) From Today = CALCULATE( SUM( 'Table'[Item2] ), FILTER( ALL( 'Date'[Date1] ), 'Date'[Date1] <= MAX( 'Date'[Date1] ) && 'Date'[Date1] >= TODAY() ))* DIVIDE( [Sum Item2], [Sum Item2])
sum item1 and sum item 2 measures are just sum of respectice columns
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
75 | |
73 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |