"expression"
4 TopicsConvert String that represents duration to a Numeric Value (number of seconds) in DAX
Assuming that I have a string that contains any of the following words: Day, Days, Hour, Hours, Minute, Minutes, Second, Seconds I wanna grab the number in front of every appearing word and depending on the type of measure multiply it with the right number to get the total number of seconds. For example if I have "2 Days 3 Minutes" then the code will calculate: 2 x 86400 + 3 x 60 = 172980 Example Input Desired Outcome 2 Days 3 Minutes 1 Second 172981 1 Hour 3600 2 Hours 15 Minutes 8100 1 Day 3 Hours 1 Minute 10 Seconds 97270 There are two challenges: 1) the string might missing one of the key words. It could be a full string like the last example in the table, but also only one of the words or a combination of those. 2) Both singular and plural forms of the words appear (Day, Days etc) depending on if it is 1 or 2 or more days.Solved622Views0likes2CommentsReport Builder - Conditional Background for a Field Using SWITCH
In report builder I want to add conditional formatting to a column (RFH_DUE_DATE) in a table, the table's main dataset is from the Tracker dataset. I created RFH_DUE_DATE from the Provider dataset. The column is created from a Lookup expression: RFH_DUE_DATE= IIf(IsNothing(Fields!RPR.Value), DateAdd(DateInterval.Day, 180, Lookup(CInt(Fields!P_ID.Value), CInt(Fields!ID.Value), CStr(Fields!NPR.Value), "Prov")), DateAdd(DateInterval.Day, 180, Fields!RPR.Value)) For the conditional formatting I want to change the fill color- -Finished: Green -Due Within 30 Days: Red -Due Within 90 Days: Yellow -Finished: If the RFH_FILED is not null or PRRB_INDIVIDUAL_CASE__ is not null or NOTES like “missed” -Due Within 30 Days: If not Finished and the RFH_DUE_DATE – Today <= 30 -Due Within 90 Days: If not Finished and the RFH_DUE_DATE – Today between 31 and 90 Here is my expression for the background fill: =switch(isnothing(Fields!RFH_FILED.Value) = FALSE, "Green", isnothing(Fields!PRRB_INDIVIDUAL_CASE__.Value) = FALSE, "Green", instr(Fields!NOTES.Value, "missed") > 0, "Green", (isnothing(Fields!RFH_FILED.Value) = TRUE OrElse isnothing(Fields!PRRB_INDIVIDUAL_CASE__.Value) = TRUE OrElse instr(Fields!NOTES.Value, "missed") = 0) AndAlso datediff(DateInterval.Day,IIf(IsNothing(Fields!RNPR.Value), DateAdd(DateInterval.Day,180,Lookup(CInt(Fields!Provider_ID.Value),CInt(Fields!ID.Value),CStr(Fields!NPR.Value),"Provider")),DateAdd(DateInterval.Day,180,Fields!RNPR.Value)), Today()) <= 30, "Red", (isnothing(Fields!RFH_FILED.Value) = TRUE OrElse isnothing(Fields!PRRB_INDIVIDUAL_CASE__.Value) = TRUE OrElse instr(Fields!NOTES.Value, "missed") = 0) AndAlso datediff(DateInterval.Day, IIf(IsNothing(Fields!RNPR.Value),DateAdd(DateInterval.Day,180,Lookup(CInt(Fields!Provider_ID.Value),CInt(Fields!ID.Value),CStr(Fields!NPR.Value),"Provider")),DateAdd(DateInterval.Day,180,Fields!RNPR.Value)), Today()) > 30, "Yellow", 1=1, "Transparent") When I run the report the entire column incorrectly turns all green, I cannot get any of the other colors in my expression to work. How can I correct this expression?952Views0likes1CommentLine-to-line amplitude
Friends good night. Help me solve an issue that I'm not able to solve. Image a table with two columns In one analysis and in the other results. For example: Analysis column - Result column Turbidity - 1.0 Color - 6.0 Ph - 7.0 Conditionivity - 147 Turbidity 1.2 Color - 6.2 Color - 6.6 Ph - 7.2 There are several mixed analyses. How would I calculate the amplitude line by line according to a filter applied in a data segmenter. Type: If I select COLOR, Bi makes an imaginary column with the color values and calculates it like this: Color - "Imaginary Table" 6.0 - null 6.2 - 0.2 (6.2-6.0) 6.6 - 0.4 (6.6-6.2) And finally, return to the average of these values (0.3)Solved479Views0likes2CommentsPick Department on the Bases of Student Selection From dropdown and Sum over All fee submitted
Hello Community, I have a scenario that to Pick Department on the Bases of Student Selection From dropdown and Sum over All fee submitted for that department. Detail 1: I have a student dropdown. (User can select 1 or more then 1 at a same time) 2: I need to pick the Department of the selected Student/Students (For Example IT, Commerace, Law etc) 3: I have to calculate the total Fee submitted for thta department. (will not consider the student but the department of that student) I need something like this Fee Submitted = VAR SelectedStudent = SELECTEDVALUE('Student'[Name]) VAR AssociatedDEPT = CALCULATE( VALUES('Student'[Department]), 'Student'[Name] IN SelectedStudent ) RETURN CALCULATE( SUM('Student'[FeeSubmitted]), 'Student'[Department] IN AssociatedDEPT Your quick response will he highly appriciated1.8KViews0likes8Comments