"count"
6 TopicsRemove duplicates and count from date column in new table
I have selected a dates column from another table and i now have them in a new column Select Col = SELECTCOLUMNS('Table') ,"Dates", 'Table'[Dates column]) I have then changed the format of the dates to MMM,Year so i have Jan24 Feb 24 Feb 24 Mar 24 etc I now want to 1 - remove duplicates 2- count the number of occurances for each month eg Jan 24 - 5 Feb 24 - 2 etc Do I do as above and count the occurances from the Dates Column from th eoriginal table or do i add another column to this table the same as Dates only without the duplciates and then count from the table containing the duplicates. so it woudl look like Dates, Date_excluding_duplicates, Count Any help really apprecaitedSolved972Views0likes5CommentsConditional Color based on COUNT for Guage Visual and multiple tables
I'm trying to show a visual of authorized position for multiple locations vs actual. RESULTS: RED gradient for 'under manned' and GREEN gradient for 'overmanned' and WHITE if authorized equals manned. Table1: all manning data every name, their job, location, etc (a living document) Columns: [NAME], [LOCATION], [JOBTITLE], etc Table2: a set document (that a director might change later based on needs) showing location, jobtitle authorized and paygrade this table includes every one of the 20 job authorizations at each of the locations. So, I might have a total entry of 16 jobcode 3X3A across all locations, but 5 here and 3 there, etc. Columns: [LOCATION], [JOBTITLE], [PAYGRADE] Current page setup is a slicer to filter by location and 20 GUAGE visuals (newCard would also work if easier) that are each filtered by a COUNT of each of the twenty Table1 and Table2[JOBTITLE] jobs... 3X3A, 3X3B, etc. This gives me two numbers to play with... Authorized and Assigned. I think the tables are linked right as I get the correct results, but... I'd love to have the visual show RED gradient if Assigned is less than Authorized, WHITE if equal, and GREEN gradient if overmanned. I've dabbled in DAX, but don't know enough to figure this out from slightly related examples. I've tried creating a new column that would do the count AND show me the difference between authorized and assigned... I'm just kinda stuck looking at a nice page I've created that is just all one color BLUE. Any thoughts?? thx, -mmSolved1.2KViews0likes6CommentsWhy is Count and Distinctcount together with Calculate giving a negative number?
I'm writing some formulas that use the Count or Distinctcountnoblank functions, but when I combine them with Calculate to filter based on a condition in the data, it returns a negative number for some of the measures but not all. Whether it's positive or negative seems to vary with the condition applied. See below for an example where I'm trying to output the count of call_id whose call type is "123". How is it even possible for this to return a negative number? How do I make it work properly without having to do a series of IF/THEN clauses? Measure Example = CALCULATE(DISTINCTCOUNTNOBLANK(table[call_id]), table[type]="123")791Views0likes4Commentscumulative count measure per row
hello i need to create a measure that calculates incentive as per below rules Achievement Incentive 1 to 5 count of sales 2$ 6 to 10 count of sales 4 $ 11 to 15 count of sales 6 $ 16 and above count of sales sales 8 $ what this means, if agent has made 15 transactions, he will get incentive of (2$*5) for first 5 transactions, and (4$*5) for next 5 transactions and (6$ *5) the 5 transactions after. so total incentive= 10+20+30=60$ i created below measure = CALCULATE(IF([MNP cumulative count]<=5,[MNP cumulative count]*2,IF([MNP cumulative count]>=6 &&[MNP cumulative count]<=10,[MNP cumulative count]*4,IF([MNP cumulative count]>=11 &&[MNP cumulative count]<=15,[MNP cumulative count]*6,IF([MNP cumulative count]>=16,[MNP cumulative count]*8,0))))) and [MNP cumulative count]= CALCULATE(SUMX(SUMMARIZE('categories trans','categories trans'[AGENT_ID],'categories trans'[AGENT_NAME],'categories trans'[TRANSDATE],'categories trans'[achievement],'categories trans'[Categoty]),[mnp distinct count]), FILTER ( ALLSELECTED('categories trans'), 'categories trans'[TRANSDATE]<=MAX('categories trans'[TRANSDATE]))) my problem is the cumulitve count does not count correctly when agent has 2 transactions in the same day. instead of counting them as 2 it's counting them as 1 also the data i have is as below table agent id agent name transaction value (achievement) date 123 abc 2 1/11/2023 456 def 1 2/11/2023680Views0likes2CommentsCalculate countax vs counta
I need your clarification I've table and I need to count all contents include numbers and text on specific column with specific condition When use calculate(countax(Roster[today shift]), Age < 34) it gives me wrong result while calculate(counta(Roster[today shift], Age < 34) give right one what's the difference between them in this case? I think I still don't understand filter concept in daxSolved1.5KViews0likes4CommentsDAX INNER JOIN query takes too long time to execute
Hello everyone, I apologize in advance for the newbie question. I created a simple dashboard that connects to Dynamics 365 Dataverse and queries accounts based on associated connections. Everything works fine but my query takes way too long to run (around 20 seconds). In the end, it is all about an INNER JOIN between the account and connection tables. The data model is quite simple: I have created a 1:N relationship between account and connection tables: Am I right to create this relationship directly in the data model in order to avoid performing a NATURALINNERJOIN in the DAX query? This is my DAX measure formula, that counts the number of account records where the connection role equals "RoleX": CountRoleXAccounts = CALCULATE( COUNTROWS('account'), FILTER( 'connection', 'connection'[record1rolename] = "RoleX" ) ) This query works fine but takes about 20 seconds to return the result and it's less than 1000 records. I imagine that this is not the right way to do it, and guess that the entire dataset of connection entity (around 15k records) is fetched several times. Could you give me your advice please? PS: This would be my SQL query equivalent SELECT COUNT(*) FROM account INNER JOIN connection ON account.accountid = connection.record1id WHERE connection.record1rolename = 'RoleX' This last query runs very quickly through SQL Server Management Studio.448Views0likes1Comment