Forum Discussion
Help with power bi dax calculation.
dancer10-10 Check the data types of your columns, number and year and make sure they are all set to Whole number or Decimal. Or, you can always do +0 to make sure any numeric text gets converted to a number.
Also, I have no idea what this line is:
calculate(countrows, filter, values(sales[customerID]),
calculate(units, 'time'[year]=currentyear)>= selectedthreshold && calculate(units, 'time'[year]= prioryear)<selectedthreshold )))
It doesn't look right at all.
Thank you. Do you know the correct logic to get the formula that I want to get based on the description above?
- Greg_Deckler3 years ago
Community Champion
dancer10-10 Try something like this:
Better Sales from New Customers - Microsoft Fabric Community
- dancer10-103 years agoNew Member
gained 2 = var current_customers= DISTINCT(Sales[customer ID]) var mindate = SELECTEDVALUE(Sales[YearONLY]) var selectedthreshold3= SELECTEDVALUE('Gain Loss Numbers'[numbers Gain/Loss]) var table_ = FILTER(ALL(Sales), IF(selectedthreshold3<[units],1) ) var previouscustomer= DISTINCT(SELECTCOLUMNS(table_, "customer ID", Sales[customer ID])) var newcustomer= EXCEPT(current_customers,previouscustomer) return SUMX(FILTER(Sales,Sales[customer ID] IN newcustomer),[units])
Is this correct? I am new to power bi. It says that there is not enough memory to complete operation.
- Greg_Deckler3 years ago
Community Champion
dancer10-10 It's really tough to say. Can you post sample/example data?