selectedvalue
45 TopicsTrying to use SELECTEDVALUE filter in a MOM measure
I have set up 2 measures to return the numeric difference between this month and last month as well as the % difference. This works well when the table isn't filtered by anything else, so the values are the same for ALL records with the current month. However, I want to add an additional filter on another column that should be set by the user's selection of a single value. I am not understanding how to set the alternate value when a single value is not selected. I also changed up the formula based on what I found when searching for how to do this. I was trying to replicate the #1 in #2 while being able to add an additional filter (Local Name). MEASURE VARIATION #1 > WORKING SUM BU Size = SUMX(FILTER('Bargaining Unit Size','Bargaining Unit Size'[Report Month]=EARLIER('Bargaining Unit Size'[Report Month])),'Bargaining Unit Size'[Bargaining Unit Size]) MEASURE VARIATION #2 > NOT WORKING SUM BU Size = CALCULATE( SUM('Bargaining Unit Size'[Bargaining Unit Size]), FILTER('Bargaining Unit Size', 'Bargaining Unit Size'[Report Month] = EARLIER('Bargaining Unit Size'[Report Month]), FILTER('Bargaining Unit Size', 'Bargaining Unit Size'[Local Code]= SELECTEDVALUE('Bargaining Unit Size'[Local Code]) )Solved3.1KViews0likes20CommentsCount of Records After Selected Date
I want to create a measure that counts the Ids where the LOI Date and the Close Date are in the same month, and I want to add a slicer where I can choose a date, and the measure only counts Ids where the LOI Date is greater than the selected date. For example, if the month is October 2024 in my Matrix and I select 10/11/2024 in the slicer, I would expect the output to be the count of all Ids where the LOI date is between 10/12/2024 and 10/31/2024 (and the close date is also in October). The following measure is returning blank for me when I select a date in my slicer (My slicer is 'LOI Date'[Date]). When I clear the slicer, the output gives me the total count of IDs where LOI Date and the Close Date are in the same month. Measure = VAR SelectedDate = SELECTEDVALUE('LOI Date'[Date]) RETURN CALCULATE ( DISTINCTCOUNT('Opportunity'[Id]), FILTER( 'Opportunity', 'Opportunity'[LOI Date] > SelectedDate && MONTH('Opportunity'[LOI Date]) = MONTH('Opportunity'[Close Date]) && YEAR('Opportunity'[LOI Date]) = YEAR('Opportunity'[Close Date]) ) )Solved459Views0likes1CommentPathContains from SelectedValue issue with GUID
I have a Table of equipment records that are connected through the Account to Regions. When I attempt to use the PATHCONTAINS() with SELECTEDVALUE() It always returns False() where if I hard code the GUID it works as expected. I created a seperate table of Regions to bypass any relationship filtering that may occur. HeirarchyRegionInPath = VAR SelectedRegion = "c4be4e26-d198-ec11-b3fe-000d3a09e9da" VS regionselected = SELECTEDVALUE('Region list'[Region]) VAR RelatedRegionPath = LOOKUPVALUE( ESI_region[HierarchyPath], esi_region[Region], RELATED(account[esi_territory]) ) RETURN IF( NOT(ISBLANK(SelectedRegion)) && PATHCONTAINS(RelatedRegionPath, SelectedRegion), TRUE(), FALSE() ) I must be missing something, all formats are text, tried Column VS measure and only measure would populate RegionSelected Tried CONTAINSSTRING() rather then PATHCONTAINS(), same result. Any help appreciated.Solved2.6KViews0likes15CommentsALL function disabled when applying date slicer
Hi, I'm new to power bi, and i'm trying to calculate the OEE in a company. I'm supposed to calculate the availability for every equipment, then the performance and quality for every component produced and then the OEE. In that way, i need several slicers to apply the specific filters and calculations i need. So, basically, i need the availability to make the calculation regarding the equipment, but then ignore the selected component. For that i use an All function im my measure to ignore component. The calculation is done correctly if i don't have the week interval selected(semana), has you can see below. If i change the selected component the availability stays the same, as it should, but if i change the week slicer to make the calculation for a specific week or weeks of the year, then everytime i change component in the slicer the availability slicer changes as well. I don't understand why, but for some reason the week slicer must be disabling the all function. Here's my measure, you can ignore most of it. It just changes the calculation depending on que equipment selected. #Disponibilidade = CALCULATE( IF( SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11197" || SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11198", // Equipamentos que trabalham 24 horas por dia util e 9 horas ao fim de semana (SUM('dados'[Tempo Seg (con. média)]) + SUM(Paragens[Tempo Paragens(segs)])) / ([#Número Dias Úteis]*24*3600 + [#Numero de dias(fds)]*9*3600 + CALCULATE(SUM('dados'[Horas Extra(s)]),FILTER(dados,dados[Dia da Semana]= "Saturday" || dados[Dia da Semana]="Sunday"))), IF( SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11140" || SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11195" || SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11196" || SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11200" || SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11201" || SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11203" || SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU11204", // Equipamentos que trabalham 24 horas por dia, dias uteis w 24 horas fds (SUM('dados'[Tempo Seg (con. média)]) + SUM(Paragens[Tempo Paragens(segs)])) / ([#Numero de Dias]*24*3600), IF( SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU13100" || SELECTEDVALUE('dados'[Nº 1º Equipamento]) = "EQU13051", // Equipamentos que trabalham 24 horas dias uteis (SUM('dados'[Tempo Seg (con. média)]) + SUM(Paragens[Tempo Paragens(segs)]) ) / ([#Número Dias Úteis]*24*3600), (SUM('dados'[Tempo Seg (con. média)])+ SUM(Paragens[Tempo Paragens(segs)]) ) / ([#Segundos Uteis] + SUM('dados'[Horas Extra(s)])) // Equipamentos que trabalham 8 horas por dia, dias uteis ))), ALL(dados[Nome Artigo Prod.]) ) Here's my tables with their relations: In this measure only the dados and paragens tables are used.1KViews0likes4CommentsHow to filter table with value related to the selectedvalue
I have the two tables below in my power bi file. I have a slicer from Table2 that uses column [Month] as the selected value. If a month is selected, I want to calculate and filter Table1 where Table1 = the associated selected [Date Rank] from Table2 + 1. For example, if 24-Jun is selected from Table2, I want to filter Table1 where [Month] = 24-May. Table1 ID Status Date Rank Previous Status Month Type Group A Normal 3 No previous 24-Mar Task <0 B Normal 3 No previous 24-Mar Task 1 to 5 C Not Normal 3 No previous 24-Mar Task 1 to 5 D Not Normal 3 No Previous 24-Mar Not Task 11 to 15 A Not Normal 2 Normal 24-May Task 6 to 10 B Normal 2 Normal 24-May Not Task 6 to 10 C Normal 2 Not Normal 24-May Not Task 6 to 10 D Not Normal 2 Not Normal 24-May Task 6 to 10 A Not Normal 1 Not Normal 24-Jun Task 1 to 5 B Not Normal 1 Normal 24-Jun Task <0 D Normal 1 Normal 24-Jun Task <0 E Normal 1 24-Jun Task 1 to 5 Table2 Date Rank Month 3 24-Mar 2 24-May 1 24-Jun1.3KViews0likes5CommentsDay over Day comparison based on selection from date slicer
Hello community, I'm looking for support in a Day over Day comparison based on selections from date slicers. I have a table with Date and ID, similar to this: Date ID Jan 3 ABC001 Jan 3 ABC002 Jan 3 ABC003 Jan 2 ABC001 Jan 2 ABC002 Jan 1 ABC001 Jan 1 ABC002 Then I have two Date slicers: Date slicer 1 -> to simply filter records based on the selected Date; Date slicer 2 -> to create a flag (Yes/No) if the records shown at step 1. are also present in the selected day In other words, if Date slicer 1 = Jan 3 and Date slicer 2 = Jan 2, the table should show the following: Date ID Flag Jan 3 ABC001 Yes Jan 3 ABC002 Yes Jan 3 ABC003 No I used the following Calculated Column to get the Flag, but as you can see it's working only with hard coded condition (Date = Date-1), rather than having the Date = SELECTEDVALUE from Date slicer 2: Flag = IF( CALCULATE (MAX (Table[ID] ), ALLEXCEPT( Table, Table[ID] ), Table[Date] = EARLIER(Table[Date])-1) = BLANK(), "Yes", "No" ) I struggle to make it work with the SELECTEDVALUE in this formula, so I'm not sure if I have to use another approach (measure, different function,...)? Any hint/recommendation is much appreciated, thanks! DavideSolved816Views0likes2CommentsError in Grand Total, Selected Value Returning Wrong Total when 'Select ALL' is Clicked
Hi everyone, I need help in resolving multiple problems in my power BI visual. The objective of the visual is to perform a comparative analysis for the actual cost of the Project with the original vendor and compare it to all the possible alternative vendors available on each of the state. Actual Result: Expected Result: Here are the important features of my visual which I wanted to work well. Feature 1: When a user selects alternate vendors using the 'MV. Vendor Name' slicer, it should update the value of 'Distribution X' and show the number of the vendors selected. This will be the basis of the computation where the Actual Hours and Cost will be equally distributed according to the number of alternative suppliers selected. Problem: The measure for 'Distribution X' is working when the user would manually select on the 'MV. Vendor Name' slicer but once the user hits 'Select All' it will show all the possible suppliers ignoring the filters applied to the other slices (Project Name/State/Vendor) DAX Code: Distribution X = VAR TotalMV = CALCULATE(COUNTROWS('Project Matching'), ALL('Project Matching'[MV.Vendor Name])) VAR SelectedMV = COUNTROWS(ALLSELECTED('Project Matching'[MV.Vendor Name])) RETURN IF(TotalMV = SelectedMV, TotalMV, SelectedMV) Feature 2: After determining the cost and hour allocations, the Cost using the New Rates (NR Cost) is now computed via measure. This will be the basis later on for the row per row computation of the savings. Problem: The measure 'NR Cost' is calculating correctly on a row per row basis, however, I expect the grandtotal to sum all the rows, however my beginner knowledge is limited. I tried applying the ones in the forum but I think I haven't really understood how Sumx iterator could do really. Dax Code: NR Cost = VAR mv_rate = [MV Rate] * [Hrs_Alloc] RETURN IF( ISBLANK(mv_rate) || mv_rate = 0 , [Cost W Inflation]/[Distribution X], mv_rate) Feature 3: Line per line computation of the Savings/Overage using the measure 'Savings/Over' Problem: As you can see in the visual my code is not returning any value at all 😭 Dax Codes: Cost_Alloc = VAR SelectedMV = COUNTROWS(ALLSELECTED('Project Matching'[MV.Vendor Name])) VAR CurrentMV = SELECTEDVALUE('Project Matching'[MV.Vendor Name], "Default") VAR acounta = [Cost W Inflation] RETURN IF( HASONEVALUE('Project Matching'[MV.Vendor Name]), IF(SelectedMV <> 0, acounta / SelectedMV, BLANK()), SUMX(VALUES('Project Matching'[MV.Vendor Name]), [Cost W Inflation]) / SelectedMV ) Savings/Over = [NR Cost]-[Cost_Alloc] I attached my dummy data and pbix in the link, should you need more context about the matter. Power BI file and Excel File Thanks so much for the help!Solved1.3KViews0likes2CommentsCheck selected row against Selected values from Slicer
Hi im trying to a put a 1 against each row where the the current row matrix interval = the slected values in the slicer (multiple selection rather than single value is possible) ive tried the below but get a 1 against each row and not the values selected in the slicer Selected Intervals To Show = VAR SelectedIntervals =ALLSELECTED(qry_previous_180_days[Revised_Time]) VAR IntervalValue = MIN(qry_previous_180_days[Revised_Time]) RETURN IF(IntervalValue IN SelectedIntervals,1,0)1.3KViews0likes6Commentsshow last value on or before selected date
Hi I have a table that contains daily balances for several accounts by date. It doesn't have an entry for every date. The user selects a date they are interested in, I would like to display each account by value on a Clutered bar chart. I am trying to create a measure that will calculate a value. If the an entry doesn't exist for the selected date I would like the value of last entry before the selected date. This is what I have so far but is giving me the error max has been used in a true/false expression that is used as a table filter LastValueAmmount = CALCULATE( [Total Value], FILTER( ALL('Statement Date'[Date]), LASTNONBLANK('Statement Date'[Date],[Total Value]) ) , 'Statement Date'[Date] <= MAX ( 'Statement Date'[Date] ) ) [Total Value] is a measure I have created and just totals the closing balance field. here is my model thank you for all helpSolved9.1KViews0likes4CommentsCONCATENATE SUBSTR DAX MEASURE
Hello, hope everyone had a good new years! Still a fairly new user to PBI, so help would be much appreciated! I have used concatenate measure, but never with 4 other column formulas. How would this be translated from SQL to DAX measure? DATE(SUBSTR(DIGITS(TABLE1),4,2) CONCAT '/' CONCAT SUBSTR(DIGITS(TABLE1),4,2) CONCAT '/ CONCAT SUBSTR(DIGITS(TABLE1),2,2)) AS MEASURE1Solved565Views0likes1Comment