urgent help with dax
29 TopicsDax Formula not working
CMLYNAACount = VAR SelectedMonth = MAX(Query1[CSMDate]) VAR LastYearSameMonthStart = EOMONTH(SelectedMonth, -12) + 1 VAR LastYearSameMonthEnd = EOMONTH(SelectedMonth, -12) RETURN CALCULATE( SUM(Query1[NACCount]), Query1[CSMDate] >= LastYearSameMonthStart && Query1[CSMDate] <= LastYearSameMonthEnd ) I am trying to get a count based on a filter however, i am not getting any results on this query. Can you advise whats wrong? I am trying to get NAC Count based off the date slicer for last year current month . e.g if slicer says november 2024 this field should show november 2023Solved852Views0likes3CommentsRack Count
Hi Everyone, I trying to find the to total rack count with the dax, can anyone help me to write a dax in power bi. current state is 7 and the next state is 8. If so, it adds 1 to the rack count. # should not consider current state = 8 and the next state = 7 or state = 7 or state = 8 State timestamp 7 01-02-2025 00:04:06 7 01-02-2025 00:04:11 7 01-02-2025 00:04:15 8 01-02-2025 00:04:23 8 01-02-2025 00:04:43 1 01-02-2025 00:04:51 1 01-02-2025 00:05:35 1 01-02-2025 00:14:51 7 01-02-2025 00:14:59 7 01-02-2025 00:15:06 7 01-02-2025 00:15:39 7 01-02-2025 00:20:47 7 01-02-2025 00:20:55 8 01-02-2025 00:21:06 8 01-02-2025 00:21:35 8 01-02-2025 00:21:43 9 01-02-2025 00:21:47 7 01-02-2025 00:21:51 7 01-02-2025 00:21:55 7 01-02-2025 00:22:31 7 01-02-2025 00:22:35 8 01-02-2025 00:22:39 8 01-02-2025 00:22:43 1 01-02-2025 00:22:50 1 01-02-2025 00:22:59 9 01-02-2025 00:23:19 7 01-02-2025 00:23:27 7 01-02-2025 00:23:31 7 01-02-2025 00:23:35 8 01-02-2025 00:24:15 8 01-02-2025 00:24:19 1 01-02-2025 00:24:27 8 01-02-2025 00:21:06 8 01-02-2025 00:21:06 8 01-02-2025 00:21:06 1 01-02-2025 00:21:06 1 01-02-2025 00:21:06 1 01-02-2025 00:21:06 7 01-02-2025 00:21:06 7 01-02-2025 00:21:06 1 01-02-2025 00:21:06 1 01-02-2025 00:21:06 8 01-02-2025 00:21:06 8 01-02-2025 00:21:06 7 01-02-2025 00:21:06 7 01-02-2025 00:21:06 1 01-02-2025 00:21:06Solved783Views0likes4Commentscalculate % Product codes not sold in all territories?
Expected output Sample data: QUANTITYORDERED 30 34 41 45 49 36 29 48 22 PRICEPERUNIT 95.7 81.35 94.74 83.26 100 96.66 86.13 100 98.57 ORDERLINENUMBER 2 5 2 6 14 1 9 1 2 SALES 2871 2765.9 3884.34 3746.7 5205.27 3479.76 2497.77 5512.32 2168.54 ORDERDATE 12/31/2019 0:00 3/12/2020 0:00 5/6/2020 0:00 6/30/2020 0:00 8/15/2020 0:00 9/2/2020 0:00 9/16/2020 0:00 9/23/2020 0:00 10/6/2020 0:00 PRODUCTLINE Motorcycles Motorcycles Motorcycles Motorcycles Motorcycles Motorcycles Motorcycles Motorcycles Motorcycles MSRP 95 95 95 95 95 95 95 95 95 PRODUCTCODE S10_1678 S10_1678 S10_1678 S10_1678 S10_1678 S10_1678 S10_1678 S10_1678 S10_1678 COUNTRY USA France France USA USA USA France Norway USA TERRITORY NA EMEA EMEA NA NA NA EMEA EMEA NASolved1.2KViews0likes6CommentsGetting All the values from one table to another using Dax Measure
Hi Everyone, Below is then dummy data model, how can i get the budget amount for GAS although there is no transaction in that account in the General Legder using measure. I have matrix visual, I have used account code and Name in rows from ACCOUNTS table, and below is my measure for getting budget, Budget = VAR Budget = CALCULATE ( SUM ( budget table[Budget] ), Budget table[month]= MAX ( General Ledger[month] ), Budget table[Year]= MAX ( General Ledger[Year] ), ALL ( Budget table[Account Code]) ) can you please help me to get the result below: Thanks Verymuch for help !!978Views0likes4CommentsHow to use USERELATIONSHIP with multiple Criteria to switch dates, when meeting the Criteria
Any suggestion on how to achieve the below requirements: I have two tables, one with 4 columns and another one is a calendar table Columns -> Created Date: Loan Amount: Approved date: Status: "Pending", " Under-Process", "Approved". I have created a relationship between the Calender table and the main table : * active relation: created date and Calendar date * inactive relation: approved date and calendar date I want to sum up the loan amount when I use the date slicer ( date column from calendar table ) -> for the status of Approved, it needs to use the Approved date column and for another status it needs to use the Created date5.7KViews0likes4CommentsCalculating Share by Owner in Power BI with Changing Ownership Percentages
I have two tables in Power BI: "Ownership" and "Sales". The "Ownership" table contains the product-wise ownership percentages by owner, while the "Sales" table contains information about the sales, including the date and product. The ownership percentages vary each quarter, and I need to calculate the share by owner based on these changing percentages. Table: Ownership product owner fy fq percentage x dattu fy24 q1 50 x dattu fy24 q2 70 x sanket fy24 q1 50 x sanket fy24 q2 30 y dattu fy24 q1 30 y dattu fy24 q2 70 y sanket fy24 q1 70 y sanket fy24 q2 30 Table: Sales date product sales 03-04-2023 x 10 04-04-2023 y 20 05-04-2023 x 30 06-04-2023 y 40 07-04-2023 x 50 08-04-2023 y 60 09-04-2023 x 70 10-04-2023 y 80 03-05-2023 x 90 04-05-2023 y 100 05-05-2023 x 110 06-05-2023 y 120 07-05-2023 x 130 05-07-2023 y 140 06-07-2023 x 150 07-07-2023 y 160 08-07-2023 x 170 09-07-2023 y 180 10-07-2023 x 190 11-07-2023 y 200 12-07-2023 x 210 13-07-2023 y 220 Our financial cycle starts on April 1st and ends on March 31st. Each financial quarter consists of three months. For example, financial Q1 includes April, May, and June. I would like to create a report with a date filter so that when the user selects a date range, the sales data is filtered accordingly. For example, if the user selects the date range from 10/4/23 to 9/7/23, the sales data should be filtered as shown below: Table: Filtered Sales date product sales 10-04-2023 y 80 03-05-2023 x 90 04-05-2023 y 100 05-05-2023 x 110 06-05-2023 y 120 07-05-2023 x 130 05-07-2023 y 140 06-07-2023 x 150 07-07-2023 y 160 08-07-2023 x 170 09-07-2023 y 180 Based on the ownership percentages and filtered sales data, I would like to create a final report as a table visual in Power BI. Table: Final Report Owner Total sanket 615 dattu 815 The calculation for the final report can be understood from the table below: Table: Calculation Details owner fy fq product perc total(ignore owner) share dattu fy24 q1 x 50 330 165 sanket fy24 q1 x 50 330 165 dattu fy24 q1 y 30 300 90 sanket fy24 q1 y 70 300 210 dattu fy24 q2 x 70 320 224 sanket fy24 q2 x 30 320 96 dattu fy24 q2 y 70 480 336 sanket fy24 q2 y 30 480 144 In the "Calculation Details" table, I have computed the share by owner based on the ownership percentages and total sales (ignoring the owner). For each owner, financial year (FY), financial quarter (FQ), and product combination, I calculated the share using the following formula: Share = Total (Ignore Owner) * Percentage Hi super users, Please kindly help stuck with 15 days amitchandak Greg_Deckler tamerj1 johnt75 Jihwan_Kim476Views0likes1CommentHow to find count of New Customers ?
Hi everyone, I will like to ask for help in this case : I need help in DAX logic for finding count of New Customers. New Customers = Distinct count of Customer Codes which have grosssalesvalue >0 in current year and grosssalesvalue = 0 in previous year note : Customer Code, grosssalesvalue are the attributes from sales fact. sales fact and calender dim have relationship. Thanks in Advance.770Views0likes2CommentsDAX - Selected value
Hi I wrote a measure where if is January is selected measure shows 1, february 2, so on till december. Measure = switch(selectedvalue (dim_table[month_name]), "January",1, "February",2) Is it possible , if both January and February are selected, measure should show 1,2. If January,February and March are selected measure should show 1,2,3. Thankyou6KViews0likes11CommentsYearly sales based on selection
I have two slicers site and period(Year, month) and a matrix having categories, sub categories as rows and sales as values. Now I need to create a dax where it shows total year sales of sub categories based on a month selection. If the user clicks on April under 2020 for one of the site, the Dax should show complete sales of the sub categories for that month year. If June 2020 is selected, the value should be same. The value should change only when a month from another year is selected and when site is changed.Solved999Views0likes4Comments