need help dax
327 TopicsCalculated Measure and Percentage is changing when used slicer and filter
Team, Good day, I am trying to calculate the percentage value for the categories against the total value. DAX formula is working fine but when slicer or filter values are filtered the outpwut is not chnaging and showing as it is. I am using below DAX function DIVIDE(SUM(RPT_CARBON_UNPIVOT[Value]),CALCULATE(SUM(RPT_CARBON_UNPIVOT[Value]),ALL()) ) Kindly help me on this on DAX function for any kind of slicer and filter thanks M. Vijay AntonySolved1.9KViews0likes2CommentsUnpivot Columns of Calculated Table
I have reviewed posts with a similar problem but I'm still having trouble unpivoting select columns from a calculated table. The table looks like this: Data[Fall Year] [Total UG] [FY+50NotCL] [FY+35NotCL] [2Y+50NotCL] [2Y+35NotCL] 2013 17842 365 25 803 74 2012 17469 306 35 698 89 2014 17869 308 19 962 67 2021 19629 589 51 1377 160 2015 18119 307 21 895 64 2016 18555 382 25 1000 77 2018 19709 376 40 1304 135 2019 20132 486 45 1263 122 2017 19103 423 44 1210 118 2020 20355 1341 119 1971 231 and I need a table that looks like the sample below, and would be SO EASY if I could use Power Query. Could someone help me with the DAX to do this? (Sample of top 20 rows) Data[Fall Year] [Total UG] Scenario Bed Count 2013 17842 [FY+50NotCL] 365 2013 17842 [FY+35NotCL] 25 2013 17842 [2Y+50NotCL] 803 2013 17842 [2Y+35NotCL] 74 2012 17469 [FY+50NotCL] 306 2012 17469 [FY+35NotCL] 35 2012 17469 [2Y+50NotCL] 698 2012 17469 [2Y+35NotCL] 89 2014 17869 [FY+50NotCL] 308 2014 17869 [FY+35NotCL] 19 2014 17869 [2Y+50NotCL] 962 2014 17869 [2Y+35NotCL] 67 2021 19629 [FY+50NotCL] 589 2021 19629 [FY+35NotCL] 51 2021 19629 [2Y+50NotCL] 1377 2021 19629 [2Y+35NotCL] 160 2015 18119 [FY+50NotCL] 307 2015 18119 [FY+35NotCL] 21 2015 18119 [2Y+50NotCL] 895 2015 18119 [2Y+35NotCL] 64Solved5KViews1like6CommentsDAX Error: A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table
Hi, I am new to DAX. I have an assignment which requires me to convert all 3 steps tables to only one table using CALCULATETABLE function. When i tried to do for the first 2 steps, there is an error shown as below. Hereby I attach the 3 steps table for your reference: Table1: forecasting_uoa_payroll_step1 = FILTER ( uoa_payslips_history_aggregated, DATEDIFF(uoa_payslips_history_aggregated[YearMonth],TODAY(),MONTH)<variable_uoa_per_cust_window[Variable_UoA_per_Cust_Window Value]+1 ) Table 2: forecasting_uoa_payroll_step2 = SUMMARIZE ( forecasting_uoa_payroll_step1, forecasting_uoa_payroll_step1[Country], "UoA Per Customer Average", AVERAGE(forecasting_uoa_payroll_step1[UoA_per_Customer]) ) Table 3: forecasting_uoa_payroll_step3 = SELECTCOLUMNS ( customer_payroll_forecast, "Date", customer_payroll_forecast[YearMonth], "Country", customer_payroll_forecast[Country], "Customers", customer_payroll_forecast[Total Headcount] ) Thank you88KViews0likes12CommentsTotal Sum in each row in a table issue of DAX
Hello Everyone, I am facing an issue , and unable to solve. I have this below data. I want 14968 Value for all the voice numbers under "Total Invoice Amount" similar to "Total test Value" column. I have achieved the Total test Value using a calculated column using Earlier fuction, But its not changing dynamically with slicer selection. With slicer selection the value should be 14968. Here Invoice Item Amount Measure2 is a Measure. The Total Invoice Amount should be "sum of allthe invoice item amount measure 2 grouped by voice number." I have written the below formulas: Invoice Item Amount Measure 2 is a Measure, Invoice Item Amount Measure 2 = SUMX( 'Invoice Hold Facts', IF( 'Invoice Hold Facts'[Highest Ranking Indicator] = "Y", 'Invoice Hold Facts'[Invoice Item Amount], 0 ) ) Total test Value is a Calculated column using Invoice Item Amount Measure 2 Total test Value = CALCULATE( [Invoice Item Amount Measure 2], FILTER('Invoice Hold Facts','Invoice Hold Facts'[Invoice Number] = EARLIER('Invoice Hold Facts'[Invoice Number]) && 'Invoice Hold Facts'[SUPPLIER_WID] = EARLIER('Invoice Hold Facts'[SUPPLIER_WID]) && 'Invoice Hold Facts'[Highest Ranking Indicator] = "Y")) ------------------------------------------------------------------------------------------------------ I have tried other methods as measures , but nothing is working. Below are some methods I tried i have commented some methods in it. Total Amount Measure = /*CALCULATE( SUM('Invoice Hold Facts'[Invoice Item Amount]), FILTER( 'Invoice Hold Facts', [Invoice Item Amount Measure] = CALCULATE( SUM('Invoice Hold Facts'[Invoice Item Amount]), 'Invoice Hold Facts'[Highest Ranking Indicator] = "Y" ) ) )*/ /*SUMX( SUMMARIZE( 'Invoice Hold Facts', 'Invoice Hold Facts'[Internal Invoice Id], "TotalInvoiceAmount", [Invoice Item Amount Measure 2] ), [TotalInvoiceAmount] )*/ /*SUMX( VALUES('Invoice Hold Facts'[Invoice Number]), [Invoice Item Amount Measure 2] )*/ /*CALCULATE( SUM('Invoice Hold Facts'[Invoice Item Amount]), ALLEXCEPT('Invoice Hold Facts', 'Invoice Hold Facts'[Invoice number]) )*/ SUMX( VALUES('Invoice Hold Facts'[Invoice Number]), CALCULATE( SUM('Invoice Hold Facts'[Invoice Item Amount]) ) ) PLEASE HELP. THANKYOU591Views0likes1CommentTrue/False column after evaluating a set of rows
Hi Everyone, I need to create a Column in DAX to create the Bold Column in below Table. It would evaluate if each row# has a True Match in "Match?" Column, then new column will be True, otherwise False Row# Attribute ValueBase ValueCompare Match? All Values in same Row# Match? 1 1 A A True False 1 2 A B False False 1 3 B B True False 2 1 A A True True 3 1 B B True False 3 2 C A False False 4 1 A A True True 4 2 A A True True 4 3 C C True True 4 4 B B True True ThanksSolved1.5KViews0likes8CommentsSame period previous N months
I want to calculate total sales for previous N months for the same period according to the slicer. Eg if in slicer I select range from 1-10-21 to 3-10-21 the my column chart should display total sales for previous N months within this range. I wrote following Dax measure for the same but not getting desired result: same period = CALCULATE(SUM(financials[ Sales]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]), -'Select N'[N Value],MONTH),FILTER(financials,AND(financials[Date]>=MIN('Date'[Date]),financials[Date]<=MAX('Date'[Date])))) Any suggestions are apprecited.3.5KViews0likes11CommentsPower BI Dax to calculate sum of quantity based on the two date time fields.
Hello All, I would like to seek help in calculating the sum of quantity based on the below condition. I’ve “created date” as data time field used in advanced filter pane with option to select the date and time format as shown below. Date Time selected in the example is (09/05/2023 11:00 PM to 09/18/2023 11:00 PM). User has the ability to change the date time selection using the advanced filtering. Need to calculate the sum of quantity only when the “Changed date” (Date Time format) is greater than the max of “Created Date” (Date Time Format) field selected using the advanced filter option. Sum of quantity will be calculated only when the “Changed Date” is greater than max of “Created Date” (09/18/2023 11:00 PM). “Created Date” will be dynamically changed based on the selected using Advanced Filtering. Need to get the max of created date time I’ve provided data and expected output for the condition mentioned above. Also, Attached the screenshot of the data. Highlighted in yellow are the data matches the condition. I would appreciate any help on the same. Thank you! Data ID State Created Date Changed Date Quantity 1160 NY 09/05/2023 11:30:00 AM 10 1161 NY 09/05/2023 4:00:00 AM 09/08/2023 10:00:00 PM 20 1162 NY 09/06/2023 8:00:00 AM 09/19/2023 4:00:00 PM 20 1163 NY 09/06/2023 7:00:00 PM 09/10/2023 6:00:00 AM 60 1164 NY 09/08/2023 10:00:00 PM 09/20/2023 11:00:00 AM 60 1165 NY 09/10/2023 6:00:00 AM 09/21/2023 4:00:00 PM 80 1166 NY 09/17/2023 9:00:00 PM 50 1167 NY 09/17/2023 11:30:00 PM 30 1168 NY 09/22/2023 2:00:00 PM 35 1169 CA 09/05/2023 11:30:00 AM 10 1170 CA 09/05/2023 4:00:00 AM 09/08/2023 10:00:00 PM 100 1171 CA 09/06/2023 8:00:00 AM 09/19/2023 4:00:00 PM 150 1172 CA 09/06/2023 7:00:00 PM 09/10/2023 6:00:00 AM 180 1173 CA 09/08/2023 10:00:00 PM 09/20/2023 11:00:00 AM 200 1174 CA 09/10/2023 6:00:00 AM 09/21/2023 4:00:00 PM 300 1175 CA 09/17/2023 9:00:00 PM 50 1176 CA 09/17/2023 11:30:00 PM 30 1177 CA 09/18/2023 2:00:00 PM 35 1178 CA 09/05/2023 11:30:00 AM 10 1179 TX 09/05/2023 4:00:00 AM 09/08/2023 10:00:00 PM 135 1180 TX 09/06/2023 8:00:00 AM 09/19/2023 4:00:00 PM 142 1181 TX 09/06/2023 7:00:00 PM 09/10/2023 6:00:00 AM 155 1182 TX 09/08/2023 10:00:00 PM 09/20/2023 11:00:00 AM 165 1183 TX 09/10/2023 6:00:00 AM 09/21/2023 4:00:00 PM 175 1184 TX 09/17/2023 9:00:00 PM 50 1185 TX 09/17/2023 11:30:00 PM 30 1186 TX 09/18/2023 2:00:00 PM 35 1187 TX 09/23/2023 11:30:00 PM 40 1188 TX 09/23/2023 2:00:00 PM 40 Expected Output State Quantity NY 160 CA 650 TX 482 Snapshot of Data. Highlighted in yellow are the data matches the condition mentioned above.Solved990Views0likes2Commentscount how many times the value is repeated
Hello! I need a help to create a new collunm at power BI using DAX. In my example I have a colunm1 with some values that are repeat. I need a collunm that count how many times the value is repeated: Colunm1 How many times A 3 A 3 A 3 B 2 B 2 C 4 C 4 C 4 C 4 D 1 Anybody can help me? Thanks a lot.Solved1KViews0likes3CommentsHow to get previous row values by grouping two columns in dax
Hi, From same Table(TableA) group two columns(Column1 and Column2) and get previous row value(from Column3) in a new custom column in dax Example Column1 Column2 Column3 Previous Row value A Value1 01/02/2021 A Value1 02/02/2021 01/02/2021 A Value1 03/02/2021 02/02/2021 A Value2 05/02/2021 A Value2 05/02/2021 05/02/2021 A Value2 04/02/2021 05/02/2021 B Value1 01/02/2021 B Value1 01/02/2021 01/02/2021 This need to be done in dax code (Column3 is custom created in dax). Please suggestSolved5.2KViews0likes5CommentsHow to sum averages
Hello everyone I have a simple measure that calculates the average: Net Cost Detail AVG = AVERAGEX( 'Product Cost Detail', 'Product Cost Detail'[Net Cost Detail]) I would like to have at the end of the visual the sum of all those values My Net Cost Detail measure is a simple SUM of a column Thank you all in advanceSolved2.3KViews0likes4Comments