division
7 TopicsTrying to create a simple measure of Projects per Staff numbers
Sorry, this is first time posting. I am a self taught PowerBI dashboard creator and I am trying to create a simple 'projects per staff number' calculation for my companies dashboard. I feel it should be easy but the numbers keep being wrong, any help would be greatly appreciated, it's been quite frustrating. Details below. The Data: I have two sources of data. A Direct Query into a SQL database (DATA1) that lists all projects, with columns for Department etc. and a spreadsheet (DATA 2) with a column for department and staff numbers. The solution: I want to create a new measure of projects per staff numbers (PPP) and have tried creating a new measure under the spreadsheet data source with code along the lines of: Projects per Person (PPP) = VAR Depart_Project_Count = COUNTAX(FILTER(DATA1[ProjectType]="PROJECT"),DATA1[Department]) VAR Staff_Count = COUNTAX('DATA2','DATA2'[Department]) RETURN ( Depart_Project_Count / Staff_Count ) No errors are produced when I run it but gets the numbers wrong, see table belwo: For Glasgow the number PPP should be 3.14 ish (44/14) no 22. Any help or pointers would be greatly appreciated. Thanks643Views0likes4CommentsMultiplying Measures by Varied Month Number
I am trying to create a measure to display the following equation: (Annual Target / Months) * (Current Month Number). I have created the following equation and understand that it works correctly, up until the IF function. I have highlighted this in bold. I do not understand my mistake. Live Target = (([TARGET 2024]) / MAX( MonthNumber[Month Number])) * (MONTH(Today()) (MONTH(Today()) IF(_month > 3, _month-3, _month+9))) Key here is that I am trying to vary the current month number so that April is regarded as the 1st month of the year.Solved663Views0likes2CommentsGet the average of a column value based on total count of values in ID column
Hi, In a table i have column called "Object" which runs multiple times in a day and that runtime is captured in "StartTime" & "EndTime" columns, and the difference between the start and end time is captured in the "Duration" Column. Each object will be having multiple runid's which is captured in "RunID" column which is a unique value. For eg: Object AAA has two runid's called "111,222" and Object BBB has one runid called "333". Now i would like to get the average of each duration by count of that particular runid which is captured in "New Duration" column. For eg: The count of 111 runid is '10'. so for all those durations with runid 111 should be divided by the 10. The count of 222 runid is '6'. so for all those durations with runid 222 should be divided by the 6. The count of 333 runid is '8'. so for all those durations with runid 333 should be divided by the 8. Sample screenshot for above query: So since my Duration is "10" and total count of runid (111) is 10. So 10/10=1 that is my newduration.Similarly for all durations with runid's 111 should be divided bt 10. How to achieve this using DAX query?? I am connecting to this table in powerbi via SQL direct query mode. Thanks.Solved1.1KViews0likes2CommentsDivide based on a grouped column
Hello everyone, I have a table with 5 columns [Date, ID, ZipCode, Numeric, Condition] Date ID ZipCode Number Condition 27/03/2020 A MTS 117525 Yes 27/03/2020 B MTS 117525 Yes 19/03/2020 C MTS 117525 Yes 25/02/2020 D MTS 0 No 20/01/2020 E FCM 120368 Yes 13/03/2020 F FCM 120368 Yes 17/03/2020 G FCM 0 No 05/04/2020 H MTS 247831 Yes 31/03/2020 I MTS 0 No 08/04/2020 J MTS 247831 Yes The goal is to divide the Number with the total count of "Yes". For ZipCode "MTS" I want to divide 117.525/3, being 3 the total number of Yes for that ZipCode and for that Number. The Number results from a condition based on the Date. For ZipCode "FCM" I want to divide 120.368/2. Again for MTS, 247.831/2 For the rows where the Condition = "No" the result should be 0. How do i lock that count for each row? Edit: I add another ZipCode to clarify the goalSolved1.2KViews0likes5Commentsdivide function returns 0 instead of number
hello i have a measure where im dividing two measures numinator : [active users 30 days ago]-[active users prevoius 30 days ago] denominator :[ active users 30 days ago] both measures im using return values seperately and when subtracting also, but after using the divide function it returns zero the DAX code for active users 30 days ago: CALCULATE(distinctCOUNT(table[user_id]),DATESBETWEEN('Calender'[Date], MAX('Calender'[Date]) -30, MAX('Calender'[Date]))) DAX code for active users previous 30 days ago: CALCULATE(distinctCOUNT(table[user_id]) ,DATESBETWEEN('Calender'[Date], MAX('Calender'[Date]) -60, MAX('Calender'[Date]) -30))) ) DAX for the division calculation= MOM= calculate(divide( [active users 30 days ago]-[active users prevoius 30 days ago],[active users prevoius 30 days ago])) the results im getting:Solved5.6KViews0likes4CommentsQUOTIENT rerurns 0 when it should not
Hi all, I have a problem with DAX functions QUOTIENT. I have "minutes spent fact" column and I want to convert it to "X day, Y hours, Z mins" format. My first step is to divide "minutes spent fact" by 60 to convert minutes to hours I'm using QUOTIENT function. Here what it returns QUOTIENT (1320, 60) should return 22. Am I right? or I get the wrong idea of this function... Here are other screen with some wrong zero resultsSolved737Views0likes1CommentSimple Division driving me crazy!
Hi all I just can't seem to understand why my tabular model is coming up with the wrong answer. All I'm doing is dividing one column by the other. ='Stock Analysis'[Physical Quantity (R)]/[Net Usage] I didn't need to use variables but I've tried lots of different ways to divide it but it keeps coming up with the same problem. 19.77686 / 0.014370 The answer is 1,978 not 1,376. Note; the first column Physical Quantity (R) is a hard number created via power query. The second number is a calcuated column which I'll include but I don't see how this should have an affect on this simple division: Net Usage='Stock Analysis'[Consumption Quantity 12 Months]+'Stock Analysis'[Sold Quantity 12 months] Consumption Quantity 12 Months=[Pick Quantity In Previous 12 Months] Pick Quantity In Previous 12 Months:= VAR CurrentDate = TODAY() VAR PreviousDate = Date(Year(CurrentDate),MONTH(CurrentDate)-12,DAY(CurrentDate)) VAR RESULT = CALCULATE( SUM([QtyReporting]), FILTER( 'Primary Date Table', 'Primary Date Table'[Date] >= PreviousDate && 'Primary Date Table'[Date] <= CurrentDate ) ) RETURN RESULT Thank you!892Views0likes3Comments