"measure"
72 TopicsHelp with Full Quarter Total
So I'm trying to get a total for salesreps quotas for the current quarter, including dates that havent happened yet so I can create a daily quota requirement and then a QTD quota based on the daily quota for sales reps to see how they are pacing during the quarter. The formula I've been trying and playing around with is: CALCULATE([Sum of RSM Quotas], 'Quotas Unrelated'[Is this Qtr] = "TRUE") But it keeps giving me the full year total. Or this formula ends up giving me the month's total so I'm assuming its trying to do QTD with only one date. CALCULATE(SUM('Quotas RSM'[Quota]), 'Combined Table'[Current Quarter] = TRUE()) In my tables, I have the sales reps quotas for each month with 1 date attached. I also have a date table with a relationship to the quota table. Heres a super simplified example of my quota data. Quota Date Sales rep 52000 7/1/2025 rep 1 98000 7/1/2025 rep 2 33000 7/1/2025 rep 3 56000 8/1/2025 rep1 91000 8/1/2025 rep 2 34000 8/1/2025 rep 3 54000 9/1/2025 rep1 93000 9/1/2025 rep 2 32000 9/1/2025 rep 3Solved1.7KViews0likes7CommentsComplex conditional summing
Hey everyone! how you doing? I have been now a month trying to make this logic work in dax but no solution. Cna anyone please help me with this? or even just say that power Bi will not be able of doing it happen? Here is the thing: I need to distribute evenly the stock of an item throught the orders of this item, in a way that the result is as shown in the table bellow: I need the stock to be distributed in a way that when its not enought to the order it will try to fit in the other order until the total stock is used. Use the stock amount of 21 for this example, you will see that the ones set as available, when summed will be exactly 21. The status column is the outcome that i need from the dax code. This is very hard, i don't even know if its possible; can anyone please helpe me with it? Thankyou a lot allready.10KViews0likes10CommentsTotal row not showing the correct amount
Hello i have this issue, i have a Measure called $ / Ton $ / Ton = SUM(BD[MXN]) / SUM(BD[Movidas]) Also this measure called Impacto: Impacto = SUMX( VALUES('BD'[Ruta]), VAR VolumenAuto = CALCULATE(SUM('BD'[Movidas]), 'BD'[Transporte] = "Auto") VAR VolumenFFCC = CALCULATE(SUM('BD'[Movidas]), 'BD'[Transporte] = "FFCC") VAR CostoPorTonAuto = CALCULATE([$ / Ton], 'BD'[Transporte] = "Auto") VAR CostoPorTonFFCC = CALCULATE([$ / Ton], 'BD'[Transporte] = "FFCC") RETURN IF(VolumenAuto > 0 && VolumenFFCC > 0, ROUND((CostoPorTonAuto - CostoPorTonFFCC) * VolumenAuto, 0), 0 ) ) In the Rows the value of Imacto is correct and if i compare it with the excel data is all good but the problem is in the total is not showing the correct amount In PBI in Excel; what am i doing wrong in the Impacto Measure? thanks in advance.Solved1.4KViews0likes10CommentsA DAX Measure to only display rows with comments that contains certain words.
Hello, I have a Power BI table containing every comment I received from my customer survey. I am trying to create a DAX measure so that when I create a table visual, it will only show me comments that contain the words "spa," "facial," or "massage." It's not working, and I'm wondering if anyone can point me in the right direction or tell me where I'm going wrong. I would greatly appreciate any help I can get. Here's an example of the table and DAX. Overall comments The cashier was so friendly the treatment I had was sooooooo good I love the scent and product variety I had a very welcoming experience The facial I had gave me a glow Best massage ever Wow! they knew it was my birthday and gave me a small cake DisplayComments := VAR Comment = SELECTEDVALUE('All Responses'[Overall Comment]) RETURN IF ( NOT ISBLANK(Comment) && ( SEARCH("treatment", LOWER(Comment), 1, 0) > 0 || SEARCH("facial", LOWER(Comment), 1, 0) > 0 || SEARCH("spa", LOWER(Comment), 1, 0) > 0 ), Comment, BLANK() )Solved2.1KViews0likes10CommentsOpening Stock & Closing Stock Calculation
I am trying to calculate Opening Stock and Closing Stock for SKUs on a daily basis, but I keep encountering a circular dependency error when referencing previous day’s closing stock as the next day’s opening stock. Data Details I have a SKU_Date_Mapping table with: SKU (Product ID) Date (Daily records) New Arrival, HL (New stock received) Actual Sales (Sales for the day) Closing Stock (Needs to be calculated) I also have an Opening table with: Ref SKUCode (Maps to SKU) Date (Only first day of each month) Opening Total KHL (Opening stock for the month) Logic Required Opening Stock (Open'HL) If it's the 1st of the month, use the value from the Opening table. Otherwise, use the previous day's Closing Stock. Closing Stock Calculation Closing Stock = Opening Stock + New Arrival - Actual Sales Issue Since Open'HL references Closing Stock, and Closing Stock depends on Open'HL, I am getting a circular dependency error. How can I correctly calculate these values without a circular dependency? I cannot use Power Query as this is a calculated table. Any suggestions would be appreciated!Solved1.1KViews0likes4CommentsSum assigned hours between 2 dates and also display grand total against each row
Hi all, I have an existing measure which calculates Assigned hours between a start and end date. This works for each single row. Assignment Hours between start and end dates = CALCULATE ( SUM ( 'Assignments'[HoursEffort] ), FILTER ( 'Dim_Date', 'Dim_Date'[Date] >= MIN('Assignments'[StartDate] ) && 'Dim_Date'[Date] <= MAX ('Assignments'[EndDate] ) ) ) What i need help with: I need to modify the measure to give me a "Grand Total Assigned hours" for the same task if it is entered multiple times with a different start and end date. In the below table I expect a "Grand Total Assigned hrs" of 20 against each row. Project Task Assigned Staff StartDate EndDate HoursEffort Grand Total Assigned hrs Project 1 Task 1 John 01/01/2025 31/01/2025 10 20 Project 1 Task 1 John 01/02/2025 28/02/2025 10 20 How can I modify the measure to give me the expected results? Or do i need to do some sort of grouping to combine the 2 rows? Many thanks in advanceSolved981Views0likes3CommentsHow to calculate a ranking score between 1 & 5
Hi there, I am having a bit of a maths & dax failure and hoping that one of you amazing people can help. I am trying to calculate a ‘5 star rating’ for the ‘completed’ column in relation to the average number of ‘completed’. The idea is to provide a ranking of how many each person has completed. Please see example below of the rating that I am trying to achieve in a table visual. The column '_5_star_rating' shows a small graphic of stars 0 to 5. Table visual Name Completed _5_star_rating (out of 5) Person1 700 5 Person2 200 2 Person3 414 3 The ‘Name’ and ‘Completed’ columns are taken from ‘table1’ and look something like this:- Name Completed Person1 1 Person1 1 Person2 1 Person3 1 i.e Person1 will have 700 rows that = 1, Person2 will have 200 rows that = 1 & Person3 will have 414 rows that = 1 This is the measure that I currently have for the ‘_5_star_rating’. _5_star_rating = Var _star = INT(DIVIDE(SUM(table1[Completed]),100)) VAR _unstar = 5 - _star RETURN REPT(UNICHAR(11088),_star) It partly works. It currently returns a graphic of stars 0 to 5, but the calculation doesnt work out the 1 to 5 ratings in relation to an overall ranking for each person under 'Name' Any ideas eternally appreciated! Thanks as always CFSolved4.3KViews0likes11CommentsForecasting current month based on previous month - measure
Hi Community, I want to create a report/table that shows the following information: . Country . qty sales (month to date) - measure already exists . qty sales last month (total month) - measure already exists . qty sales CM Total (forecast current month based on previous month) - need to create . variance qty sales (month to date) - need to create Example below: Date = 14 Nov MTD October (total) Forecast November (total) var CM/LM (MTD) United States 800 1500 1714 18% France 220 450 471 8% Germany 200 500 429 -11% Spain 175 400 375 -3% Can you help me? Thank you!Solved1.5KViews1like4CommentsColumn of related Table breaks measure
Hello, I have two Tables (A and B) and have a meassure (using only data from A) which works fine in my table visual, but when i add a column from Table B to the visual, the meassure breaks. SUMX(FILTER('A, 'A'[Flag]=1), 'A'[Value1] / 60 * 'A'[Value2]) I think the Problem is the many to many relatioship between A and B. For Key in A there are three rows in Table B matching B contains translations from differnt languages for that code. When i switch the added collumn from don't ssummarize to First or Last the problem resolves. Normaly a slicer on the page should filter unessecery translation in Tbale B, but they appear when i add the collumn to my table visual. Sorry for poor decription. But is there a way, maybe to Filter Table B in my measure with the selection made in my slicer, so i dont need to select first to get rid of unwanted translations?991Views0likes6CommentsCount on a measure
HI All, I have a running Measure in my pbi where i the out put is put into four seperate catagories. What i would like to have is a count of how many there are of each of the catagories, but i cant seem to get a sum or count fucntion that works. CALCULATE( SWITCH( TRUE(), [Avg. Days Untill Contract Expires] > 1095, "> 3 years", AND([Avg. Days Untill Contract Expires] <= 1095, [Avg. Days Untill Contract Expires] > 730), "2-3 years", AND([Avg. Days Untill Contract Expires] <= 730, [Avg. Days Untill Contract Expires] > 365), "1-2 years", AND([Avg. Days Untill Contract Expires] <= 365, [Avg. Days Untill Contract Expires] > 180), "< 1 year", AND([Avg. Days Untill Contract Expires] <= 180, [Avg. Days Untill Contract Expires] > 0), "< 6 month", ISBLANK([Avg. Days Untill Contract Expires]) , "None"), ALL('Date') ) Thanks in advance967Views0likes5Comments