Dax comparison do not support value type text and value type integer - powerbi

i am trying to count from two columns
Column A contains category name i.e. AAT and CCAB
column B contains scores i.e 1,2,3,4 etc
i am trying to count how many people have CCAB (from column A) and score 3 from Column B.
i get an error saying "dax comparison do not support value type text and value type integer"
how can i do this, please

You can use this measure to get result.

Related

Power BI function that checks if multiple specified values (numbers) exist in a column

Is there a function in Power BI that can check whether a list of specified values (numbers) exists in a column?
For example, in the image below, I have a column with some values and another one with 0 and 1s. You can see that some values are marked with 1 and some with 0. In order to do this, I used IF function, but this is just too cumbersome.
I am looking for a formula that can check if the values from a list like {XXXX, XXXX, XXXX, etc} exist in a column and that can easily be edited when I need to add other values.
Thank you and have a good day!
Best,
Denis
You can do that by adding a custom column for example. If we assume your table is named Table and first column is named Value, then add a custom column like this:
Where the list contains all the values of interest. This will give you a boolean column Flag:
If you want an integer column with 0 and 1 values, then change the column to something like this:
= if (List.Contains({"5006", "4905"}, [Value])) then 1 else 0

Custom column in Power-Query with mixed data types

I want to create a custom column in Power-Query-Editor, and I have two different column types:
Number RequestedDate
110 03.12.2019
100 30.04.2020
The new column should look like:
Code
10003.12.2019
10030.04.2020
How can I do so, the code: [Number]&[RequestedDate]gives an error.
One possible to solution is to use the formula Text.From, then you convert the numeric type and the date type to text form:
=Text.From([Number])&Text.From([RequestedDate])
That should work in "create custom column".

Comparing numbers in Calculated Column formula, inside a simple OR Condition then IF Condition is not returning Correct Value in SharePoint

Simply trying to compare numbers in formula for calculated Column Total Days in Route. The numbers to be compared are returned by subtraction like TODAY()-[CurrentRouteDateTemp] where the column CurrentRouteDateTemp is of type Date
See column descr
Why is it still just returning the value from the main calculation i.e. TODAY()-[CurrentRouteDateTemp] Why the rest of the condition not working????
See list view
Try to add value function in the formula, like this:
or(value(TODAY()-[CurrentRouteDateTemp])=43725,value(TODAY()-[CurrentRouteDateTemp])<0)

Can't count cells populated by a RegExMatch function

I am attempting to count the sum of a column populated by a RegExMatch function but using a COUNT function, eg =COUNT(F2:F100).
The function that populates a cell with '1' is:
=IF(RegExMatch($E2,"SKU123"),"1","")
I can see '1' appear many times in the column but when I attempt to sum the column I get a zero answer.
Any suggestions for how I perform a better RegExMatch (or alternative) or way to sum the column?
Change your formula from
=IF(RegExMatch($E2,"SKU123"),"1","")
to
=IF(RegExMatch($E2,"SKU123"),1,"")
and will work.
COUNT returns the number of numeric values in a dataset, and you were filling with strings. SO in your version it will always return 0.

Excel Vlookup Function

I have a spreadsheet that contains two worksheets. Each Worksheet contains the C column which I need to only extract the last numbers after the dash. So in Cell D it does this by using the formula:
=TRIM(RIGHT(SUBSTITUTE(C2,"-",REPT(" ",100)),100))
and the correct number is shown in Cell D as you can see.
A B C D E
250 stevem GP CONSTRUCCION-9-50399 50399 4/12/2013 0:00
223 stevem ANIMATIC MEDIA-9-50400 50400 4/12/2013 0:00
224 stevem DIGITAL ENGINEE-9-50401 50401 4/12/2013 0:00
I then need to do a vlookup on cell D in sheet 1 and match it with Cell D in sheet two which contains the same formula for extracting only the last digits after the -
My Vlookup is:
=VLOOKUP(D:D,Sheet2!A:F,2)
but I think because the lookup cell does not contain Just values, but rather a formula that returns a value, I get an error #N/A
Will Vlookup work for what I am trying to do?
(#N/A) returned by a VLookup means that the value was not found. My guess is that the issue is you are looking for values of D from Sheet 1 in column A of Sheet 2.
The VLookup function has parameters of [Lookup Value],[Table Array],[Column Index Num],[Range Lookup]
Lookup Value is the value you are searching with.
Table Array is the range of values to search in. The first column is what is searched.
Column Index Num is the column number of the table array whose value should be returned if the Lookup value is found. If there are multiple instances of the Lookup value in the table array then the function returns the first instance.
Range Lookup is true or false and determines if you only use and exact match -False, or a near match -True.
The table array you select is Sheet2!A:D and the column index number you have is 2. This means the vlookup is looking for the value in column A and if it is found will return the value in column B. If the value is not found then the vlookup returns a general error (#N/A). If needed you could capture this with the IFERROR() function wrapped around your VLOOKUP() function.
You describe you want to search for the value in column D of sheet 2 but you don't express what value you want returned. If you want just the number returned then setting the range to only one column will suffice.
Example:
=vlookup(D1,Sheets2!D:D,1,False)
This VLOOKUP() function is looking for the value D1 in the column D on Sheet 2 and if it is found it returns the number otherwise it returns (#N/A) and does an exact match search.