@dax
140 TopicsDAX Switch & nested IF
https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-challenge-nested-if-or-switch-is-not-working/m-p/4792912#M183444 i can't belive there is no solution for this, i need a simple dax measure IF( ISINSCOPE( HIER[LEVEL_7_DESC] ), 17, IF( ISINSCOPE( HIER[LEVEL_6_DESC] ), 16, IF( ISINSCOPE( HIER[LEVEL_5_DESC] ), 15 ) ) ) this doesn't work because if i change the order of column in the visual then the higher or the first condtition will always be the only one is true returning this value only?!!Solved2KViews0likes8CommentsSales LY till same period
Hello I have a report with the measure: CALCULATE( [Vendas], SAMEPERIODLASTYEAR('Date Table'[Date]), 'Date Table'[Month Number]<=MONTH(MAX(SaleTransactionDetails[CreateDate])) It gives me the LY sales till the same month of the maximum sales dates. However, how can I do it if I want to calculate the LY sales till the same last year date? For example, if I have sales between 01/01/2025 and 03/09/2025, sales LY sould sum the lst year sales between 01/01/2024 and 03/09/2024.Solved883Views0likes6CommentsTotal Customers (end of month)
Hi Everyone, Could you help me configure this? create a DAX measure that calculate the Total Customers (end of month) based on total customers at eriod of time and cancelled customers. Note: all metrics was calculated by measures. pbidaxhelp daxdax dax daxdaxdaxSolved2.5KViews0likes13CommentsDAX rolling churn for the month (MTD)
Hi guys, I’d like to ask for your assistance in getting the correct output. The goal is to calculate a rolling daily count of churned services. Appreciate your help in advance. SUMMARIZE( ADDCOLUMNS( churn_services, "Date", churn_services[disconnectiondate], "Customer Type", churn_services[customertypename], "Measures", "MTD Churn", "Product Category", churn_services[productcategoryname], "UB Group", churn_services[groupname], "Total Churn Services", CALCULATE( DISTINCTCOUNT(churn_services[serviceid]), FILTER( ALLEXCEPT( churn_services, churn_services[customertypename], churn_services[productcategoryname], churn_services[productitemname], churn_services[groupname] ), churn_services[disconnectiondate] <= MAX(churn_services[disconnectiondate]) && MONTH(churn_services[disconnectiondate]) = MONTH(TODAY()) && YEAR(churn_services[disconnectiondate]) = YEAR(TODAY()) ) ) ), [Date], [Measures], [Customer Type],Solved1.9KViews1like10CommentsRelated products in Checks
Hello Community I have a table of receipts containing: date, receipt ID, product ID, amount, and quantity of goods sold. One receipt can contain several items, for example. Receipt with identification number M00012 contains the following goods: identification numbers 21, 22, 25, 26. Such There can be many such receipts, and they may contain identical items. In the visual matrix, I display the receipt ID, amount, and quantity. Now I sort by amount and see which product was purchased the most, and now my task in another visualization is to see which products were related in those receipts where the product I highlighted in the matrix table was. PBIX file exampleSolved786Views0likes4CommentsDAX Calculated Column with "variable tables" as variables.
Greetings I'm attempting to create a calculated column that brings out a result based on the rowscount form another table. The relation is ONLY the id of each individual. The following illustrates the relationship between 2 appointment tables, each of a diferente service. Basically, if a person with an appointment on the left table has an apointment on the right table (along some other variables related to dates and service details), the result is either YES or NO, depending on whether the rowcount of a variable, filtered AND related table is more than 0, or not. column = --[state] can adopt values 1 to 5, and there are blank values. var table1 = filter(relatedtable(table2), not(isblank([state]))) var table2 = filter(relatedtable(table2), [state] in {1, 2}) var table = if(countrows(table2) < 1, table1, table2) var conditioned_tableA = filter (table, ## additional conditions related to date and other variables.##) var countB = countrows(conditioned_tableA) var conditioned_tableB = filter (table, ## different conditons from A ##) var countB = countrows(conditioned_tableB) return switch ( true() , countA > 0, "YES" , countB > 0, "NO" , "YES" ) However, I'm getting the error the expression refers to multiple columns. multiple columns cannot be converted to a scalar value Of course, I know that I can't treat a table as a single value, or viceversa. But that is not what I want. The basis table can either be table1 or table2 depending on wether table2 holds any records. But my end result still is just the count of rows. ¿Any ideas?Solved986Views0likes4CommentsList of values with filter, kindly help me!
Hi Team, Kindly help me for filter visual. I have the 'Data' column and categories columns. like below snapshot format. we required filter, If I select categories col of 'a' then "a" related all data shown like below snapshot. If select 'b' then "b" related of all data required. How to it in DAX with this? Note:- In power query it is possible, by splitting muliple cols and we will do it. but have performacne impact, kindly help me to it using DAX?Solved750Views0likes4CommentsPercentage Calculation using multiple tables columns -DAX Function
Greetings, I have three table(s) in Semantic layer and have one-to-many with bi-directional relationship between tables and I have shown the sample DAX function the below I have used for my reports. Table-1: has only one record per id Table-2: can have many records and the grain is name and Id Table-3: can have many records and the grain is name, outcome Table-1 Table -2 Bi-directional - One to Many Table-1 Table-3 Bi-directional - One to Many Outcome %= DIVIDE(SUM('Table-2'[Hours]) , CALCULATE( SUM('Table-2'[Hours]), ALLSELECTED('Table-3'[Outcome]) ) ) Category Group %= DIVIDE(SUM('Table-2'[Hours]) , CALCULATE( SUM('Table-2'[Hours]), ALLSELECTED('Table-3'[Category Group]) ) ) Question-1: I have created data group column on category and when I use data group column percentage, its working as expected but if I create the column in Power query using category and use the column in percentage like the below, it’s not working as expected. Any thoughts on this. Category Group %= DIVIDE(SUM('Table-2'[Hours]) , CALCULATE( SUM('Table-2'[Hours]), ALLSELECTED('Table-3'[Category Group]) ) ) Question -2: I have created Donut chart or pie chart or graph, its working for one specific column either category or outcome. If I drill down to Category Group from Outcome or from Category Group to Category, it's not working as expected and showing the values as 100%. I have changed the logic the below this but no luck Category Group %= DIVIDE(SUM('Table-2'[Hours]) , CALCULATE( SUM('Table-2'[Hours]), ALLSELECTED('Table-1'[Category Group]) , 'Table-1'[Category ]) ) ) Is there any way to write a single Dax measure to support all three combinations to create percentage metric. I have shown the sample table the below for your quick reference. Table-2 Name Category Category Grp Outcome Total Hours Grand Total Percentage Outcome Percentage Outcome Grp Percentage Name-1 Category -1 Category -1 Outcome -1 7 19 36.84211 = (7/19)*100 = 7/19 *100 Name-1 Category -2 Category -2 Outcome -2 4 19 21.05263 = (7/19) *100 =4/19*100 Name-1 Category -6 Other Outcome -2 3 19 15.78947 = (7/19) *100 =8/19*100 Name-1 Category-8 Other No Outcome 5 19 26.31579 =(5/19) *100 =8/19*100 Do you have any other recommendations ? Thanks you in advance for your help on this. Table-2 Table-3 Table -1 ID Table 2 Name ID Outcome ID name Category Category Group Hours 1 Name -1 1 Outcome -1 1 name 1 Category -1 Category -1 5 2 Name -1 2 Outcome -1 2 name 2 Category -1 Category -1 2 5 Name -1 5 Outcome -2 3 name 3 Category -1 Category -1 4 8 Name-1 8 Outcome -2 4 name 4 Category -2 Category -2 3 10 Name-1 10 No Outcome 5 name 5 Category -2 Category -2 5 6 name 6 Category -2 Category -2 5 7 name 7 Category -5 Category -2 3 8 name 8 Category -6 Other 2 9 name 9 Category -7 Other 6 10 name 10 Category -8 Other 6Solved1.6KViews0likes2CommentsDax measure query required of below shared expressions. kindly help me!
Hi Team, Good Afternoon! Kindly help me for DAX measure query of below 2 expressions. 1. Sum([ABC] * [DEF] / 100) 2. Sum((case when [AAA]>1 then [AAA] / 100 else [AAA] end) * [XYZ]) / Sum((case when [BBB]>1 then [BBB] / 100 else [BBB] end) * [XYZ]) I required measures due to need to call this final values in the card visual. please help me.Solved1.4KViews4likes5Comments