dax direct query
16 TopicsDynamic date substitution
Hi, implementing write back with PowerApps have two tables one with order number, amount and requested delivery dates (table 1) another with order number and confirmed delivery date (table 2). Table1 is in import mode, Table2 is direct query mode (data is being populated through PowerApp). both tables are connected to the same calendar table Trying to write a measure that would "use" date in table 2 if available for a delivery amount from table 1 for a matrix visual in PBI. any successful experience implementing something similarSolved2.5KViews0likes14CommentsDirect query - add values from other table to the main table with conditions
Hi, I have created model in "direct query" mode, I dont have experience with it. (I normaly use add Column with combination formulas Calculate + Allexept... now it doesnt work) I need to add values from one column in "table B" to the "table A" for Column xID. I have this conditions: max values from "Column Order" -1 for each Column xID determine value in Column Personal ID in Table A, which is key for connect to Table B. The unique key for this situation in Table A is combination Column xID with Column Personal ID (because values from Personal xID can be repeated). I need to add value from Table B - Column Name to the new Column in Table A (in need can by measure), duplicated for same Column xID values. (Table A has over 23 milions rows)821Views0likes3CommentsDynamic Measure Required with two slicer
Hi Folks, I'm trying to develop the dashboard by comparing two months and their uses of two slicers. I prepared the dashboard using Excel Formulas. please help to develop Power-BI As the Raw data is attached Excel is available. please refer it Google Drive Link for Excel File Please feel free to contact for more info if required. RAW Data Period Account Value X Value Y Value Z Fix Tata 4 3 5 Fix Birla 6 7 8 Fix Adani 7 8 9 Fix RIL 8 9 10 Fix Tata 9 10 11 Fix Birla 10 11 12 Jan Adani 11 12 13 Jan RIL 12 13 14 Jan Tata 13 14 15 Jan Birla 14 15 16 Jan Adani 15 16 17 Feb RIL 16 17 18 Feb Tata 17 18 19 Feb Birla 18 19 20 Feb Adani 19 20 21 Feb RIL 20 21 22 March Tata 21 22 23 March Birla 22 23 24 March Adani 23 24 25 March RIL 24 25 26 March Tata 25 26 27 March Birla 26 27 28 March Adani 27 28 29 April RIL 28 29 30 April Tata 29 30 31 April Birla 30 31 32 April Adani 31 32 33 April RIL 32 33 34 April Tata 33 34 35 Regards, MOHITSolved898Views0likes2CommentsGetting differences between 2 outputs in Dax
Some context: I am connected Direct Query to a dataset so i cannot use calculated columns or change the dataset in any way. I need to accomplish this in dax. I have a measure that shows me all the tickets touched by "Team1" Note: The "MyTeam" table contains many different ticket numbers but the same ticket number can also repeat in the table for each team that touches it is a new row in the table. TouchedByTeam1 = CALCULATETABLE(VALUES(MyTable[Ticket]), FILTER(MyTable, MyTable[Definition] = "Team Group"), FILTER(MyTable, MyTable[Team] = "Team 1")) I have another measure that gets me al the tickets Team 1 touches but doesnt not move to another team. FirstTeam1Touch = VAR LastTouchTeam = CALCULATE( MAXX(MyTable, MyTable[Team]), FILTER( MyTable, MyTable[Start] = CALCULATE(MAX(MyTable[Start]), ALLEXCEPT(MyTable, MyTable[Number])) ) ) VAR FirstTeam1Touch = CALCULATE( MIN(MyTable[Start]), MyTable[Team] = "Team 1", ALLEXCEPT(MyTable, MyTable[Ticket]) ) RETURN IF( LastTouchTeam = "Team1", FirstTeam1Touch, BLANK() ) I have been at this for the last couple weeks and havent figured it out. I put both of these measure in the same Measure as variables and have been trying to use "Except" to get the difference but nothing seems to work. This was my last attempt with everything in variables. Obvisously the Except doesnt work becuase the FirstTeam1Touch does not output a table being it is a calculate statement. VAR LastTouchTeam = CALCULATE( MAXX(MyTable, MyTable[Team]), FILTER( MyTable, MyTable[Start] = CALCULATE(MAX(MyTable[Start]), ALLEXCEPT(MyTable, MyTable[Ticket])) ) ) VAR FirstTeam1Touch = CALCULATE( MIN(MyTable[Start]), MyTable[Team] = "Team 1", ALLEXCEPT(MyTable, MyTable[Ticket]) ) var TouchedByTeam1 = CALCULATETABLE(VALUES(MyTable[Ticket]), FILTER(MyTable, MyTable[Definition] = "Team Group"), FILTER(MyTable, MyTable[Team] = "Team 1"), FILTER(MyTable, MyTable[Created] >= EOMONTH(TODAY(),-2)+1 && MyTable[Created] < EOMONTH(TODAY(),-1)+1)) var total = CALCULATETABLE(EXCEPT(TouchedByTeam1, FirstTeam1Touch)) Any help is greatly appreciated.561Views0likes1CommentCalculating over all run time for each date
Hi, I have used this below query to get the overall run time (excluding overall intervals) for a single date. But how to get the run time for each of the batch_dates as im representing in graph visuals - the computed data is incorrect. By removing the condition SchedulerInfo[BATCH_DATE]=ALLSELECTED(TenantDetails[BATCH_DATE]) also not helps, Query used: xDayendTimeALL = IF(ISBLANK(MAX([PRCS_START_TIME])),BLANK(), VAR __Table1 = ALL('SchedulerInfo') VAR __Table1_1 = FILTER(__Table1,IF( SchedulerInfo[xCoreSystem] IN VALUES(INTRL_TBL_CORE_SYSTEM[xCoreSystem]) && SchedulerInfo[BATCH_DATE]=ALLSELECTED(TenantDetails[BATCH_DATE]) && SchedulerInfo[LDBID_INL]=ALLSELECTED(TenantDetails[LDBID_INL]) && SchedulerInfo[LDBID]=ALLSELECTED(TenantDetails[LDBID]) && SchedulerInfo[PRCS_STATUS] in values(PRCS_STATUS[PRCS_STATUS]) && SchedulerInfo[xProcessModule] IN VALUES(INTRL_TBL_PROCESS_MODULE[xProcessModule]) &&SchedulerInfo[PROD_LNE] IN VALUES(INTRL_TBL_PROD_LNE[PROD_LNE]),1,0)) VAR __Start = MIN(SchedulerInfo[PRCS_START_TIME]) VAR __End = MAX(SchedulerInfo[PRCS_END_TIME]) VAR __Table = GENERATESERIES(__Start,__End,1/24/60) VAR __Table2 = GENERATE(__Table,__Table1_1) VAR __Table3 = ADDCOLUMNS(__Table2,"Include",IF( [Value]>=[PRCS_START_TIME] && [Value] <= [PRCS_END_TIME] ,1,0)) VAR __Table4 = GROUPBY(__Table3,[Value],"Minute",MAXX(CURRENTGROUP(),[Include])) VAR cTime=SUMX(__Table4,[Minute]) VAR _hrs = QUOTIENT ( cTime , 60 ) VAR _mins = INT ( cTime - _hrs * 60 ) VAR _sec = MOD ( cTime , 1.0 ) * 60 RETURN FORMAT(_hrs,"00")&":"&FORMAT(_mins,"00") )551Views0likes1CommentGet 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.1KViews0likes2CommentsDAX calculation for removal of duplicate rows
Hi, For the source table below , I have repeated rows one for India and another for Delhi location . Another for India and Goa location. I want to hide all those rows with India(marked in bold in the below table) location and want to only keep the rows with Delhi and Goa location .I have many enteries like this so it should be don via some DAX. Please suggest. Source Indput: School location Averagemarks ABC India 90 ABC Delhi 90 DEF India 89 DEF Delhi 89 DEJ India 75 DEJ Goa 75 DEM India 97 DEM Goa 97 Expected Output : School location Averagemarks ABC Delhi 90 DEF Delhi 89 DEJ Goa 75 DEM Goa 97 Kind regards SameerSolved1.2KViews0likes2CommentsDAX calculated columns to create Date Tables
Hi All, I need to create a Date Table [Data Table] using any possible DAX measures or DAX calculated columns. I need the output in the below expected format.Please suggest. so I basically want to show current month, year, previous month along with the month start and end dates. I want it for the whole year for 2021,2022 and 2023..Please suggest Current Month Year CurrentMonthStart CurrentMonthEnd Previous Month PreviousMonthStart PreviousMonthEnd January 2022 01-01-2022 31-01-2022 December 01-12-2021 31-12-2021 February 2022 01-02-2022 28-02-2022 January 01-01-2022 31-01-2022 March 2022 01-03-2022 31-03-2022 February 01-02-2022 28-02-2022 April 2022 01-04-2022 30-04-2022 March 01-03-2022 31-03-2022 May 2022 01-05-2022 31-05-2022 April 01-04-2022 30-04-2022Solved1.9KViews0likes5CommentsDAX to calculate the count of flags based on filter selection
Hi All, In the below school table and 3 drop downs location, schoolname and relativedates, I need to find the count of the flags 1 and 0 when I select the location and school name in the drop down and select the relative dates in a relative filter for date column which filters This month, previous month valuesetc. So, based on these three filters I should get the count of the flags 1 and 0 and display the values in the scorecard visual. Here 0 stands for the students who reserved seat and were present in schoolcompetition and 1 stands for students who didn't reserve seats but were present in the schoolcompetition. Expected results: My score card visual should show the count values for both scenario 1 and scenario 2 Scenario1 : Select location as chennai and school name as A and relative date as Last month then the total flag count for values (0 and 1) should display 4 in the scorecard visual as there are 4 row counts in the selected filter range. Scenario 2: Select location as Delhi and school name as B in the filter dropdown and select relative date filter as This month(present month) then the flag count for (0) should return. so in this case it should display 4 row count in the scorecard visual in the selected filter range. Can you please suggest any DAX to handle this case scenario? Input Source data Date SchoolName Location Flag StudentID 02.08.2021 A Chennai 1 100 02.08.2021 A Chennai 1 101 10.08.2021 A Chennai 0 102 12.08.2021 A Chennai 1 103 24.08.2021 B Delhi 0 104 16.09.2021 B Delhi 0 105 16.09.2021 B Delhi 1 106 16.09.2021 B Delhi 0 107 18.09.2021 B Delhi 1 108 21.09.2021 B Delhi 0 109 22.09.2021 B Delhi 0 110 22.09.2021 B Delhi 1 120 kind regards, SameerSolved5.5KViews0likes4Comments