summary
6 TopicsPerformance problems with what-if parameter
Hi, I have an important performance using a what-if parameter. The formula below works reasonably well considering that the LLAMADAS table have millions of rows: RACS. = CALCULATE( COUNTROWS( FILTER( SUMMARIZE('Llamadas', LLAMADAS[FK_MATRICULA], "ATEND", LLAMADAS[Llamadas Atendidas]), [ATEND] > 150 ) ) However, when I substitute the threshold of 150 by a what-if parameter the measure doesn't work: RACS. = VAR minLlm = [Umbral Llm] RETURN CALCULATE( COUNTROWS( FILTER( SUMMARIZE('Llamadas', LLAMADAS[FK_MATRICULA], "ATEND", LLAMADAS[Llamadas Atendidas]), [ATEND] > minLlm ) ) ) )770Views0likes4CommentsHelp with creating a summary table
Hello, I am trying to create a summary table and could use some help! I am trying to calculate the amount of time an employee is in a particular pay plan (salary). For a data source, I am using a change log from an employee database. For privacy purposes, I have modified the data to cleanse it. However, below are some examples of what I am working with and what I am trying to accomplish. Scenario 1: ChangeRequestID EmployeeID PayPlanID Date JobTitleID 8886 400 12 12/20/2020 19 6360 400 11 12/22/2019 19 3713 400 9 5/27/2018 19 3163 400 8 2/4/2018 6 1972 400 7 2/5/2017 6 In this scenario, the employee has one record for each promotion, or move into the next pay plan. The outcome I am trying to get in this scenario is as follows: PayPlanID Duration (days) 12 709 11 364 9 574 8 112 7 364 I am wanting the duration column to represent the number of days the employee was in that pay plan. It's calculated by looking at the difference from that record until the next record, with the exception of the most recent record, which uses today's date for the calculation (since the employee is still in that pay plan). Senario 2: ChangeRequestID EmployeeID PayPlanID Date JobTitleID 13964 693 9 10/10/2021 4 12532 693 7 8/15/2021 5 7547 693 7 9/13/2020 6 6904 693 8 3/29/2020 4 5246 693 7 3/31/2019 9 In this scenario, the employee's play plan does not consistently increase. They took another job which had a lesser pay, and then eventually worked their way back up. In this scenario, I am looking for the same output as in scenario one. Below is the expected outcome: PayPlanID Duration (days) 9 415 8 168 7 756 I tried creating a table using SUMMARIZE(), grouping by EmployeeID and again by PayPlanID, however I wasn't sure what expressions I could use to calculate the duration in days. It would be much easier if I had a start & end date in the record, but I do not. Only the date the change was submitted. I would really appreciate any help or guidance on this! Thanks! ChrisSolved840Views0likes2CommentsSummarizing Capacity Allocated & Capacity Remaining for a Bookable Resource
Hi all - long time lurker, first time poster, so apologies in advance if this is the incorrect sub: I am hoping to summarize completed/scheduled event duration data with values from three tables. table A - Events: Contains running registry of training events. Calculated columns use DATEDIFF to return event duration (event end date/time - event start date/time) in hours and minutes table B - Trainer Logs Maps the user guid of a bookable resource (in this case, a contact with a "Trainer" designation) to the guid of the event in table A in which that Trainer's time was used table C - Trainer Capacity Trainer's name, guid, and a hard-coded quarterly hours value (160) The goal is relatively straightforward: For each unique trainer ID + trainer name in table B/C, summarize: the QTD count of Completed vs. Scheduled events (from table A). Any event with a end date < today = "Completed"; with start date > today = "Scheduled" the duration in hours tied to those Completed/Scheduled events (table A) the sum of hours completed QTD + hours Scheduled QTD (let's call it "Hours Booked or Completed") Deducting the "Hours Booked or Completed" value from the hard-coded maximum allowable hours (160) that any one trainer has available in any one quarter should then allow me to arrive at a % of Quarterly Hours Used value, which would prove useful when answering the question of which trainers have the capacity remaining to book them with future events. I contemplated bringing the trainer_id value (table B) into the events table (table A) via LOOKUPVALUE, but was unsure if there was a more elegant solution that virtualized this relationship. Lastly, it's worth noting that an event can have multiple trainers assigned to it. In these instances, I'd like to avoid counting a single event with duration = 8 hours and >1 trainer assigned as 8 hours consumed by each assigned trainer, such that the duration of the event is split by the number of trainers assigned, i.e.,: If duration = 8 hours && assigned trainer count = 1, then deduct 8 hours from trainer 1's capacity If duration = 8 hours && assigned trainer count = 2, then deduct 4 hours from trainer 1's capacity and 4 from trainer 2's capacity If duration = 8 hours && assigned trainer count = 3, then deduct 2.67 hours from t1, 2.67 hours from t2, 2.67 from t3 ...etc. Link to sample data below. Thanks sample data EDIT: Public link1.4KViews0likes1CommentDistinctCount where Count > Than X
Hey all, I'm having trouble getting my measure to work correctly. I have a fact table that looks like: TestID StudentID Date Result In Period 1 1 3/1/20 Fail Yes 2 1 8/4/20 Fail Yes 3 2 1/1/19 Pass Yes It's related to my User Dim table with cross filtering set to both. I'm trying to get my measure to calculate a distinctcount of students who failed a test more than once in a 12 month period. My current formula is: Repeat Risk Users = var timesfailed = CALCULATE(COUNT('Fact Test Details'[TestID]),'Fact Test Details'[Result]="Fail",'Fact Test Details'[In Period]="Yes") var repeatfail = CALCULATE(DISTINCTCOUNT('Fact Test Details'[StudentID]),FILTER('Fact Test Details',timesfailed>1)) Return repeatfail I've tried different variations of this, including trying a var summarize table, but nothing is giving me accurate numbers. var timesfailed is giving the correct count of failures, but var repeatfail is giving an inaccurate result--way to high. No matter what i change the Filter timesfailed greater than to, the number is the same, unless I change it to =0. Not sure what is wrong. Any suggestions would be awesome!Solved1.7KViews0likes4Commentshow to summarize several columns into a new table
I have data in in this format: column1, column2, column3 0, 1, 1 1, 1, 1 1, 0, 1 1, 0, 1 How can I summarize the data into a new table where the first column contains the column name from above, and the second column contains the sum for each column above: column1, 3 column2, 2 column3, 4Solved2KViews0likes8CommentsTable with IF function totals to zero
Hi there, I'm new to DAX and am probably making a mistake because I'm applying Excel logic! I have employee data, which I used to create a table with headcounts and a measure of % Female: The tricky part is when I want a count of how many countries have % Female >= 30%. I added a measure: Meets Criteria = IF ((Female HC]/ [Total HC]) >= 0.3, 1, 0) It works fine in the table, but the total is 0, when it should be 2. Could someone give me a hand here? Thank you!Solved4.7KViews0likes4Comments