How to Running Total for condition function in Crystal Report - if-statement

Hi I use Crystal Report 2016,
I have Running Total of number values (Number of hours - #P.soucet0 ). Then I have Formula field with formula
if {#P.soucet0}>50 then {#P.soucet0}-50
else 0
How can I get Total of this Formula?
Running Total doesn't show it for Evaluation and When I use Formula Field to Sum it: sum({#if})
, it says that You can't sum this Function.
Can someone please help me?
Thank you

Related

Calculating weighted weekly average

I´m trying to calculate the weekly average of a certain value but I don´t know how Power BI is running to output what I get.
This is the table with the relevant raw data:
And this is what I´m getting:
For the week "6-OCT-12-OCT", the expected average should be 2.3% instead of the -28.29% shown.
Please, notice the value 1 is calculated as a "new measure". Could someone please tell me what is going on and how can it be properly done?
Thanks in advance!

PowerBi - Row total in Matrix report for measures in Direct Query report

Id appreciate some help with a problem that I would otherwise be able to crack in seconds in Excel but cant wrap my brain around in PowerBI
I have direct access to a SQL database and am looking to report on the percentage of times a person attends an Appointment. A measure 'No Show' calculates if they dont as follows:
No Show = IF(COUNT(Candidate[bookingId]) = SUM(Candidate[deleted]), 0,1)
Unfortunately, this means that the total No Show for each Candidate is 1, even if they didnt attend 2 or more appointments.
I cant cant wrap my head around whats needed to get the total No Shows for the Candidate.
In the example, the expected result is 2 No Show and 66% No show %.
[Current state and Desired State]
Ive included a sample view here >> 1
Appreciation in advance for any help

How to calculate Average of a column while ignoring the error in PowerBI?

Hi everyone,
I have a table in PowerBI as shown in the first screenshot above. I want to calculate the average WA (Weighted Average) for both Topic 1 and 2. After obtain the average value, then I want to plot the value in the column chart together with the weighted average for Topic 1 and 2 as shown in the second screenshot. The weighted average for Topic 1 is 0.43 while for Topic 2 is 0.50, hence the Average for both Topic 1 and Topic 2 should be 0.465 ~ 0.47.
One of the challenging here is that my data consist of error NaN, so somehow need to ignore the NaN when doing the calculation for Average value.
I'm still new to DAX, hope to get some help and advice on this problem, thank you!
Can you please try with some DAX code as below-
AVERAGEX(filter(Table, WA <> "NaN"), Table[WA])

DAX formula for Time

Time formula in Power BI
What I am trying to do:
If any train departed >= 59 sec, then "1", or else "0".
The formula I am using:
=if([Actual-Planned]>=time(00,00,59),"0","1")
This is partially working. It does give me "0" in the case where actual-planned time is 59 seconds, whereas per formula it should give me "1".
It works when I put it as (00,04,59) but does not work for seconds.
Has anyone come across this issue before?
right so this is my formula:
=if([Actual-Planned]<=time(00,00,59),"RTSF","RTSA"), which means if any time a train is less than or equal to 59 seconds it will achived Right time start or else fail, i guess i am getting the output now, as i changed to smaller than or equal to instead of greater. Thanks for your help

How to sum measures per group in PowerBI

Here's the edited version:
I have this sample table using powerbi where %Currnt is a measure and the rest is column. I also have filters where i just selected area=asia and salesoffice=australia and fyear =2018. I have to sum up %currnt column(measure) and place it under ExpectedResult column.
But as you can see in my current resultset, when i sum the %Current seems like its it returns its average (0.485) rather than the sum (0.97). I need to get the sum of the %currnt first. My expected result is 0.97 per row
Does anyone of you encounter the same problem? Let me know if you find any solution. Appreciate your help. Thanks
FYear FMonth CurrentAR TotalAR CountFY %Currnt ExpectedResult**
2018 August, 2018 18,000.00 25,000.00 2 0.72 0.97
2018 July, 2018 33,000.00 130,000.00 2 0.25 0.97
**0.485**
not sure I have understand your problem, but you have to consider that, in DAX, when creating a measure, the context of the query is everything.
I mean that if you create a measure to count or calculate something, DAX apply it the current context of the data, ie if you apply filters, these filter is applied to the context. So maybe, you should consider create measure that is context free for the calculation of the MAX CountFY column using CALCULATION DAX formula.
Let me know if this helps. If you want to go further can you post and sample data to investigate deeper on your problem?