"beginner asks help"
30 TopicsHow to show latest date as default selection in a slicer.
Hi Team, Please help me out with this query. How to show latest date as default selection in a slicer. For Example, we have a date column contains date from 01-10-2022 to 22-12-2023. So, when i drag to slicer i need to show defalut selection as 22-12-2023. If user need to select other date he need select. otherwise it should be default. Thanks & Regards, Prasad38KViews0likes14CommentsDax Query Not working
CurrentMonthLastYearCount = VAR SelectedMonth = MAX(Query1[SetupDate]) VAR LastYearSameMonthStart = EOMONTH(SelectedMonth, -12) + 1 VAR LastYearSameMonthEnd = EOMONTH(SelectedMonth, -12) RETURN CALCULATE( SUM(Query1[NewCount]), Query1[SetupDate] >= LastYearSameMonthStart && Query1[SetupDate] <= LastYearSameMonthEnd ) I am trying to write a query which shows current month last year in my matrix based on slicer date selection but this query wont return any reuslts and would show up as blankSolved1.1KViews0likes4CommentsWPA Expiry Analysis getting MAX Function Error
For this employee, whose WPA expires on 09-08-2024, I need to search in columns WPA 1, WPA 3, WPA 4 (with a role filter for Floor Leader), WPA 5, WPA 9, WPA 10, WPA 11, WPA 12, WPA 14, and WPA 15 to retrieve the latest date and compare it with the WPA expiry date. If the date is before the WPA expiry date, it's marked as expired. If it's within 30 days of expiry, it's labeled as expiring soon. Only the entries in WPA 4 column corresponding to the Floor Leader role are considered. I'll implement this using DAX Example Data : Employee Role WP1 WP2 WP3 WP4 WP5 WP6 WPAEXPIRY Adam TERMINAL 05-12-23 10-08-23 22-08-23 10-08-23 10-08-23 09-08-24 FLOOR 10-08-23 I Have created dax for VAR LatestExpirationDate = MAXX ( VALUES ( 'All'[Employee Name] ), MAXX ( ROW ( "WPA1 Latest Date", 'All'[WPA1 Latest Date], "WPA2 Latest Date", 'All'[WPA2 Latest Date], "WPA3 Latest Date", 'All'[WPA3 Latest Date], "WPA4 Latest Date", 'All'[WPA4 Latest Date- for Terminal], "WPA5 Latest Date", 'All'[WPA5 Latest Date], "WPA9 Latest Date", 'All'[WPA9 Latest Date], "WPA10 Latest Date", 'All'[WPA10 Latest Date], "WPA11 Latest Date", 'All'[WPA11 Latest Date], "WPA12 Latest Date", 'All'[WPA12 Latest Date], "WPA14 Latest Date", 'All'[WPA14 Latest Date], "WPA15 Latest Date", 'All'[WPA15 Latest Date] ), MAX ( 'All'[WPA1 Latest Date], 'All'[WPA2 Latest Date], 'All'[WPA3 Latest Date], 'All'[WPA4 Latest Date- for Terminal], 'All'[WPA5 Latest Date], 'All'[WPA9 Latest Date], 'All'[WPA10 Latest Date], 'All'[WPA11 Latest Date], 'All'[WPA12 Latest Date], 'All'[WPA14 Latest Date], 'All'[WPA15 Latest Date] ) ) ) RETURN IF ( LatestExpirationDate < MAXX(VALUES('All'[Employee Name]), MAX('All'[WPA EXPIRY])), IF ( DATEDIFF ( LatestExpirationDate, MAXX(VALUES('All'[Employee Name]), MAX('All'[WPA EXPIRY])), DAY ) <= 30, "Expires Soon", "Expired" ), "Not Expired" ) but i am getting Error Too many arguments were passed to the MAX function. The maximum argument count for the function is 2. Looking for support thanks in advance 😊506Views0likes1CommentWorking with NA data
Hi, I'm still learning and did some research into the topic. It looks like Power BI doesn't have an ifna function like excel and uses lookupvalue. I looked at those threads, but couldn't figure out how to apply it to my situation. I'm working with City data that has a quadrant system (NW, SW, NE, and SE). The source has two sets of quadrant data. Normally I would assume they are the same and choose one, but life is just never that easy. Note, this is a sample and not indicative of how many N/A's are in each column. Priority I'm assuming I will need to add a new column, but I don't know how to write the formula. It would compare "quadrant" and "geo_area_quadrant". If the two are equal, then it doesn't matter which column it pulls from. If either is N/A, choose the column with data that isn't N/A. Add on option A (if possible) I'm not sure if this is possible, well an easy way for the following ask... this is an issue with the raw data. In the instances where both columns are N/A, is it possible to extract data from an address column? If so, could it be combined with the column in my priority ask above, or would it be an additional column? Thanks in advance!Solved954Views0likes2CommentsCondition is not working
Data Sampple: Local FPV'[prod Cat] Local FPV'[Markets] Local FPV'[Cigarettes Per Pack (Product Information)] Local FPV'[Cigarettes Per Outer (*)] 0 CA04 180 180 0 CA04 18 180 0 CA04 180 180 0 TW04 122 50 1 DE04 50 88 already measures are created based on the condition Local FPV'[prod Cat]= 0 then [#Gross_FPV] Local FPV'[prod Cat]= 1 then [#Gross_otp] Current Dax #G = Var selval=SELECTEDVALUE('Local FPV'[prod Cat],"Nothing Selected") RETURN ROUND(IF(selval=0,[#Gross_FPV],IF(selval=1,[#Gross_otp],BLANK())),3) Now i want add new calculation if below condtion match then [#Gross_180_cal] Local FPV'[prod Cat] Local FPV'[Markets] Local FPV'[Cigarettes Per Pack (Product Information)] Local FPV'[Cigarettes Per Outer (*)] 0 CA04 180 180 IF( Local FPV'[prod Cat] =0 && Local FPV'[Cigarettes Per Pack (Product Information)]=180 && Local FPV'[Cigarettes Per Outer (*)=180] #Gross_FPV_180 IF( Local FPV'[prod Cat] =0 && Local FPV'[Cigarettes Per Pack (Product Information)]<>180 && Local FPV'[Cigarettes Per Outer (*)<>180] [#Gross_FPV] IF Local FPV'[prod Cat]= 1 then [#Gross_otp] created DAX but [#Gross_FPV_180], this condition code not working Var selval = SELECTEDVALUE('Local FPV'[prod Cat], "Nothing Selected") Var market = SELECTEDVALUE('Local FPV'[Markets], "Unknown Market") Var cigpack=SELECTEDVALUE('Local FPV'[Cigarettes Per Pack (Product Information)],"Nothing selectd") var cigouter=SELECTEDVALUE('Local FPV'[Cigarettes Per Outer (*)],"Nothing selected") RETURN ROUND( SWITCH( TRUE(), selval = 0 && cigpack =180 && cigouter=180, [#Gross_FPV_180], selval = 0 && cigpack <> 180 && cigouter= <>180, [#Gross_FPV], selval = 1, [#Gross_otp], BLANK() ), 3 ) selval = 0 && cigpack =180 && cigouter=180, [#Gross_FPV_180] this condition not working .please any one help me ..Solved892Views0likes1CommentAchieving Filtering in Dynamic Power BI Matrix
I'm working with a dynamic matrix in Power BI, where the rows can change based on one field parameter (e.g., from audience to brand), and the values can change based on another field parameter (e.g., from bounces to clicks). The columns represent different weeks. My goal is to filter the matrix to display only rows where the total across all weeks is greater than zero. However, when I select a different field (e.g., changing from bounces to clicks), the filter also changes to match the selected metric. I want the filter to remain consistent and filter out all rows where the column total is zero, regardless of the selected metric. How can I achieve this?Solved1.2KViews0likes2CommentsExcel Formula based on time convert to DAX
I want to convert below Excel fomulas to DAX. i have mentioned Excel column headers and AM & PM model static values, BQ BR --- EXCEL COLUMN HEADER TIME T1 03:00 03:15 03:30 03:45 04:00 04:15 04:30 04:45 05:00 05:15 05:30 05:45 06:00 287 06:15 06:30 06:45 07:00 258 07:15 07:30 07:45 08:00 231 08:15 109 08:30 219 AM MODEL: CO -- FACTOR EXCEL COLUMN PRESENTATION ESTIMATE DOMESTIC AM MODEL START TIME:00:01:00 FINISH TIME:08:45:00 ALPHA BETA X BEFORE WEIBULL FACTOR 3.5 1.2 0.25 2.25 0.0041 0% 0.50 2.00 0.0456 4% 0.75 1.75 0.1755 13% 1.0 0 1.50 0.4104 23% 1.25 1.25 0.6845 27% 1.50 1.00 0.8874 20% 1.75 0.75 0.9764 9% 2.00 0.50 0.9975 2% PM MODEL: CV -- FACTOR EXCEL COLUMN PRESENTATION ESTIMATE DOMESTIC PM MODEL START TIME:09:00:00 FINISH TIME:23:59:00 PM ALPHA BETA X BEFORE WEIBULL FACTOR 3.7 2.3 0.25 3.50 0.0003 0% 0.50 3.25 0.0035 0% 0.75 3.00 0.0157 1% 1.00 2.75 0.0448 3% 1.25 2.50 0.0995 5% 1.50 2.25 0.1859 9% 1.75 2.00 0.3050 12% 2.00 1.7 5 0.4491 14% 2.25 1.50 0.6022 15% 2.50 1.25 0.7437 14% 2.75 1.00 0.8559 11% 3.00 0.75 0.9309 8% 3.25 0.50 0.9725 7% EXCEL OUTPUT : USING FORMULA : FOR TIME START TIME:00:01:00 FINISH TIME:08:45:00 =(BR21*$CO$11)+(BR20*$CO$12)+(BR19*$CO$13)+(BR18*$CO$14)+(BR17*$CO$15)+(BR16*$CO$16)+(BR15*$CO$17)+(BR14*$CO$18) START TIME:09:00:00 FINISH TIME:23:59:00 PM =(BR66*$CV$11)+(BR65*$CV$12)+(BR64*$CV$13)+(BR63*$CV$14)+(BR62*$CV$15)+(BR61*$CV$16)+(BR60*$CV$17)+(BR59*$CV$18)+(BR58*$CV$19)+(BR57*$CV$20)+(BR56*$CV$21)+(BR55*$CV$22)+(BR54*$CV$23) EXCEL OUTPUT : TIME T1 02:00 02:15 02:30 02:45 03:00 03:15 03:30 03:45 1 04:00 12 04:15 37 04:30 67 04:45 80 05:00 69 05:15 59 05:30 67 05:45 72 06:00 62 06:15 58 06:30 84 06:45 121 07:00 148 07:15 164 07:30 183 07:45 208 08:00 227 08:15 225 08:30 208 how to convert this formula to dax for time based withAM and PM static value ? looking for support .. thanks in advance698Views0likes1CommentCustom Comparison Filter
I want to create a way a user can select a drop down and you can compare the data based on current date range against what is selected. Similar to Google Data Studio. You can select to compare current date range vs. last period, last year or a custom date range you select. I feel like this is possible, using parameters but unsure. I would want to this with rates or calculated measures like CPM, CTR, CPC etc752Views0likes1Commentcounting instances where logic occurs on 2 rows
employee InstID DateTime transactionID InstanceName Date 7 O222 30/05/2023 09:11 YWJPM View product succeeded 30-May-23 8 O222 11/09/2023 10:32 YWJKN View product succeeded 11-Sep-23 4 O111 14/06/2023 20:24 YWJH84 View product failed 14-Jun-23 2 O222 21/07/2023 07:39 YWJA24 View product succeeded 21-Jul-23 3 O222 05/04/2023 09:19 YWJ7V5 View product succeeded 05-Apr-23 3 O333 05/04/2023 09:20 YWJ7V5 Update product failed 05-Apr-23 I'm trying to create a measure where I count all the occurences of 'transcationID' "YWJ7V5" occurs; the employee has done step 1 ('InstID' "O222") and viewed the product, and step 2 ('InstID' "O333") failed to update the product. I want to count on 'transcationID', so that the count would be 1. For context, I am trying to create multiple measures so that I can track where the failure has occured on a journey when making changes to a product in the database. Not sure if I should be created a calculated column? Many thanks in advance.Solved1.5KViews0likes7CommentsDax to calculate distinctcount of ID of previous month and current month based on filter selection.
Hi everyone, I want to calculate distinct count of product ID based on the filter selection of date. Lets say, I select month Sept in the date slicer. I want to show the distinct count of products of the selected month and the previous month of it. And it has to be filtered with status A only. Which I can add it in the filter pane. I wrote the following dax but I am not able to get the result. XYZ = VAR A = SELECTEDVALUE('r Data'[date]) RETURN CALCULATE( DISTINCTCOUNT(' Data'[product_id]), FILTER(' Data', ' Data'[date] = A && 'Master Data'[date] = A - 1) ) I have attached the data as well for the reference. Date format is same as it is here. Please suggest an alternative way or share your thoughts on this. Thank you 123abc lbendlinSolved1.4KViews0likes5Comments