Quicksight - Cumulative sum with Start End Dates - amazon-quicksight

Im looking to build a cumulative sum in Quickight with Start and End Dates.
I have RunningSum which gives me a clear cumulative but I want to be able to show count when the end date passes.
The image shows example data - I want to be able to show the reduction of sum when end date passes.
Example Data

Related

How to get average value over last N hours in Prometheus

In Prometheus I want to calculate the total average of this specific power metric (dell_hw_chassis_power_reading) within a period of time. For example, the last 2 hours.
I currently am using this query below:
sum(avg_over_time(dell_hw_chassis_power_reading[2h])) by (node,instance)
This query seems to only give me the latest value within that 2-hour interval specified in the query. It does not give me the total average for all scrapes of that metric within the 2-hours.
The query avg_over_time(dell_hw_chassis_power_reading[2h]) returns the average values for raw samples stored in Prometheus over the last 2 hours. If Prometheus contains multiple time series with the dell_hw_chassis_power_reading name, then the query would return independent averages per each matching time series.
If you want calculating the average over all the time series with the name dell_hw_chassis_power_reading, then the following query must be used:
sum(sum_over_time(dell_hw_chassis_power_reading[2h]))
/
sum(count_over_time(dell_hw_chassis_power_reading[2h]))
If you need the average per some label or a set of labels, then the following query must be used:
sum(sum_over_time(dell_hw_chassis_power_reading[2h])) by (labels)
/
sum(count_over_time(dell_hw_chassis_power_reading[2h])) by (labels)

Cognos 10 Row cumulative expression

Im trying to make a cumulative formula to add the percentages up in the row with the percentages before it. it can be a random amount of columns ranging from 1 to 15 for example.
This shows me the percentages in a crosstab. i just need to make another crosstab that cumulatively adds the percentages
'percentage(Count( [Pickticket Control Number]))'
I've tried running totals and not manages to make headway. any help would be great.
for context there are 3 crosstabs. One is count of pickktickets, two is count of picktickets as % and third needs to be count of picktickets cumulative as a percentage.

Cumulative sum with time-intelligent slicer using dax in powerbi

I'm new to Power BI, and I'm working on this measure to show cumulative sum on specific time period.
The case and what I want:
I have one Calendar table [DateKey], and main data table [Data], they have relationship based on column date.
I need to show a visual of line & clustered column chart and a time slicer, in which cumulative sum of revenue based on the slicer.
For eg: I have revenue table for July, I put out the DateKey[Month] column as slicer, when I choose July, the visual would show the cumulative sum of Revenue in July (from 1st to 31st July)
When I choose August, the visual would show cumulative sum Revenue in August (from 1st to 31st August)
What I tried: I used the following DAX
Cumulative Sum Rev = CALCULATE(
SUM(Data[Revenue]),
FILTER(
ALL(Data),
Data[Date]<=MAX(Data[Date])
)
)
Actual outcome: It did create a cumulative sum line, but it was fine for July. If I choose August in slicer, it would be cumulative sum from July to August. What I expected is the cumulative sum will begin from August, not from July.
I tried another solution, which is using ALLEXCEPT instead of ALL, but it does seems not working for date column (you can see my measures in the pbix files already have it, but to filter another column [Lead_type], which works perfectly fine for another slicer)
Cumulative Sum Rev = CALCULATE(
SUM(Data[Revenue]),
FILTER(
ALLEXCEPT(Data,Data[Lead_type]),
Data[Date]<=MAX(Data[Date])
)
)
Please help to show me where I was wrong.
Here is the link to my pbix file, it include what my visual would be and my measure:
https://1drv.ms/u/s!As4H0zrXywmbhaVFDprZ6RJmFUMbbg?e=l4Wxe5
What you are after is a "Month-to-date" measure. This is a built-in time intelligence function in DAX - you can also make your own version using the correct variables and DAX syntax - this carries more flexibility. However, for this case, this should do the trick:
First add a measure that sums the Revenue column. It is always smart to have these simple aggregating measures - when you use these measures in other measures, they are wrapped in a CALCULATE statement automatically, and this avoids some confusion down the road:
Revenue Amount := SUM ( Data[Revenue] )
Then add a TOTALMTD measure, which takes the first measure as the first argument, and your date column as a second argument. Note: the date column is in your DateKey table - do not use the date column in your fact table for this:
Cumulative sum =
TOTALMTD (
[Revenue Amount] ,
DateKey[Date]
)
You should also read up a bit on calendar tables and the difference between creating a table using ADDCOLUMNS and adding individual calculated columns on top of a calculated table. I would start here: https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Power BI Matrix Totals calculating incorrectly for

I am currently having an issue with the power bi Matrix Calculation when using dax. I need to calculate the Running total for overtime per fortnight, which I have achieved using the following
Lieu running total to Date = CALCULATE(SUM('Table1'[OT]),FILTER(ALLSELECTED('Calendar'[Date]),ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)))
However I now need to calculate the excess hours (OT) which I have used the following to calculate people over 90 hours(additional 10 hours)
Excess Lieu2 = IF([Lieu running total in Date]>=160,[Lieu running total in Date]-160,0)
The issues is the the grand totals is calculating the entire total - 160
The the last few total rows as well as the grand total are aggregating incorrectly...ANy help is greatly appreciated. A Dax solution is needed as this will need to be dynamic as the employees names will be added
Add a new measure with below code and add that measure to your matrix.
Total_Lieu_running_total_to_Date =
SUMX (
SUMMARIZE (
table,//add the table from which the pay period end date is coming
table[pay period end date],//date column which you are using in matrix
"Lieu_running_total_to_Date",
[Lieu running total to Date] //measure which you using currently
),
[Lieu_running_total_to_Date]
)
Note:- Please add some sample data so it would help other to give you solution quickly.

Display count for a day using counter metrics in data dog

We have a counter metric in one our micro services which pushes data to DataDog. I want to display the total count for given time frame, and also the count per day (X axis would have the date and Y axis would have count). How do we achive this?
I tried using sum by and diff with Query value representation. It gives the total number of the count for given time frame. But I would like to get a bar graph with the X axis as the date and the Y axis as the count. Is this possible in DataDog?
It seems like there are 2 main questions here:
display the total count for a given time frame.
the count per day.
I think the rollup method is going to be your friend for both questions.
For #1 you need to pass in the time frame you want a total over: sum:<metric_name>.rollup(sum, <time_frame>) and the single value can be displayed using the Query Value visualization.
For #2 the datadog docs say you can get metrics per a day by
graphed using a day-long rollup with .rollup(avg,86400)
So this would look something like sum:<metric_name>.rollup(sum, 86400) and can be displayed a Timeseries with bars.

Resources