values
31 TopicsDAX comparison operations do not support comparing values of type Text with values of type Integer
I facing the error for newly created columns. Total_Review_Not_Blocked = IF('4-all_daily_companies_review_listing'[Total_Review_Moderated]=1 && '4-all_daily_companies_review_listing'[is_blocked]=0 && OR('4-all_daily_companies_review_listing'[is_overridden]=1,'4-all_daily_companies_review_listing'[is_overridden]=0), 1,0) Total_Review_Published = IF('4-all_daily_companies_review_listing'[Total_Review_Not_Blocked]=1 && NOT(ISBLANK('4-all_daily_companies_review_listing'[company_id_captured])), 1,0) Power BI return with this error msg: DAX comparison operations do not support comparing values of type Text with values of type Integer Anyone can solve this issue?Solved29KViews0likes4CommentsDAX Contains multiple values from list
Hi! I have table 1 with column which can contain multiple names, and the table 2 with separate names. I'm wondering is there any way to filter the first table if the column with name contains at least one name from table 2. For example: Table 1: Names Value A, B 10 B 10 C, A 10 C, D 10 F 10 Table 2: Name A C CALCULATE( SUM(Value), CONTAINSSTRING(Table1[Names], VALUES(Table2[Name])) - this measure isn't working, I know, but for example. I need this measure to return 30. I also know that I can use CONTAINSSTRING(Table1[Names], MAX(Table2[Name])) and put slicer with Table2[Name] value, but I'm just wondering maybe there can be any possibility to solve my task. Maybe there is something like CALCULATE( SUM(Value), Table1[Names] IN VALUES(Table2[Name])), but "IN" means equals, and I need it to be contain. Many thanks in advance.Solved3.7KViews0likes3CommentsAdd row/filter context to SUMMARIZECOLUMNS measure
Hi, I have the following measure, which works on a total level, but not in a table visual with fields from another table (dimCampaigns): Unique Opened = CALCULATE ( COUNTROWS ( SUMMARIZECOLUMNS( fctActivities[CONTACT_ID], fctActivities[CAMPAIGNID], fctActivities[SUBJECTLINE], "CountEmailOpen", CALCULATE ( COUNTROWS ( fctActivities ), fctActivities[ACTIVITYTYPE] = "EmailOpen" ) ) ) ) This is probably because SUMMARIZECOLUMNS doesn't have a row context (as stated by this article). So I figured I would have to somehow retrieve such a value from the filter context of the table visual containing data from 'dimCampaigns' into the measure manually (by using VALUES). So I created the following: Unique Opened = CALCULATE ( COUNTROWS ( SUMMARIZECOLUMNS( fctActivities[CONTACT_ID], fctActivities[CAMPAIGNID], fctActivities[SUBJECTLINE], "CountEmailOpen", CALCULATE ( COUNTROWS ( fctActivities ), fctActivities[ACTIVITYTYPE] = "EmailOpen", VALUES(dimCampaigns[CAMPAIGNCATEGORY]), VALUES(dimCampaigns[NAME]) ) ) ) ) This still works on the total level, but still not in the table visual. It's the following table visual where I would like to add the measure to, but if I use the above measure it gives the dreaded error "SummarizeColumns() and AddMissingItems() may not be used in this context.": I think I'm close, but I just cannot get it to work. Any help would be much appreciated, thank you!3.7KViews0likes6Commentsfunction Values doesn t return Table of values but error
Hi, I want to use VALUES function and study from https://dax.guide/values/ that input is table/column and output table (one or more columns) I tried to od it on most simplest case but it failed, can sombebody told me why ? everything seems OK based on DAX guide, what I missed ? Current Data Model My DAX formula Measure = VALUES(Locations[Location]) When I tried to test it on table Measure = VALUES(Locations) I got another error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value." I am totally confused, because there is only one condition that input parameter must be table or column, any ideas what I missed ? (Don t think so that DAX.guide is wrong in description) thanks in advance!3.6KViews0likes14CommentsCount Unique values between a date range
Hey, Had to share this as i've been trying to figure it out for a week now. Finaly got it. So the intention of the below is to add a column in that defines if the row is between the start data and end date, adding a "Yes/No" where true or false. It then filters the table on "Yes" and counts the unique values in a specific coulmn. Where i have used this is to count the tickets raised last month and then compare to the tickets raised the previous month to show a specific increase or decrease in ticket numbers. This took me ages to figure out, hopefully helps someone else! Unique Count = VAR StartDate = EOMONTH(TODAY(),-2)+1 VAR EndDate = EOMONTH(TODAY(),-1) RETURN CALCULATE( DISTINCTCOUNT(Table1[Refference]), Filter( ADDCOLUMNS( Table1, "Last Month", IF(Table1[CLOSE_TIME_Month_Year] >= StartDate && Table1[Table1] <= EndDate, "Yes", "No")),[Last Month] = "Yes"))3.3KViews0likes0CommentsCreate miscellaneous/other group using count below a threshold
I've got a Line and Stacked Column Chart (using this because of Pareto line). I used to create a measure "Count". Count = CALCULATE ( COUNTROWS ( Projects ), ALLSELECTED ( Projects ), VALUES ( Projects[Points] ) ) "Project[Points]" is the Shared axis and "Count" is the Column values. Now I want to use this measure and combine any calculated values below 3 into a miscellaneous/other group. So it would be removing "M" thru "g", and creating an "other", stacking them all together. I've been using power bi for about 2 months now. So the more steps explained the better. Thank you.Solved3KViews0likes6CommentsRANKX to do a TOPN - Lot of Data and Rows - Errors
Good Morning my Friends. Im having some problems and i Believe you guys are able to help! I have a List with over 80.000 Key IDs. Each Key ID represents a Travel. I Wanna do a TOPN List to show just the "more expensives" travels that were made... So I wanna be able to show 25, 50 and 100 differents Travels inside my Dashboard Table. So i tried to follow some steps and do First a RANKX, than a TOPN/TOPNValues Table, and finally a mesuare with a IF to do the LogicalTest between the TOPN Value Selected and my Value's Rank Position to show or not that value. Just like we can see in this video: https://www.youtube.com/watch?v=SsZseKOgrWQ The problem is, How i have more then 80.000 Rows when PowerBI tries to Rank it all in a Dashboard Table its keep Charging and Charging for a very Long times and never ends.... Until my Dashboard table presents an error.... Is there Any other option to do this? I believe that is important to say that i wanna Filter my values not just using the TOPN but using others Filters as which Sector has requested the Travel.... So If I Filter by Saying Sector A requested the Travel I Wanna show the 100s most expansibles Travels that Sector A requested.... If I Filter by Sector B, the same.... and if i Have no Sector Filter I wanna Show the 100s most expansibles Travels made by The Country(Sector is not important in this case) I thought about using an TOPN Function, to Get the first 5000 Values in a new Table and then do the RANKX there, with less Data and less Row(5000 vs 80.000). My fear is that : "What if some of My more Expansibles Travels of one of my Sectors is under those 5000 first Values?" I dont think its the ideal solution.... It most have something better.... If the Dashboards Table Filter were Dynamic it would be Perfect.... But how it is not if i use the Dashboards Table Filter i can only choose to Filter by one Constant Number always... And i wanna be able to change for Differents TOPN numbers(Filter by 20, 50, 100, or any other number I Prefer) ...Solved2.6KViews0likes8CommentsSUMMARIZECOLUMNS produces an error using as a virtual table -> FOLLOW UP
I posted a question regarding a problem I faced with SUMMARIZECOLUMNS. I got a great solution, but unfortunatelty no answer to my followup question, so here it is again. My original post: SUMMARIZECOLUMNS produces an error using as a virtual table My solution margin check total group VIRTUAL = VAR virtualtable = SUMMARIZECOLUMNS(SalesTable[Customer],"code",[Margin check code]) VAR selectedcode = SELECTEDVALUE(MarginRange[Code]) VAR returnsum = CALCULATE( COUNTX(virtualtable,[Customer]), TREATAS(virtualtable, SalesTable[Customer],MarginRange[Code]), FILTER(virtualtable,[code] = selectedcode)) RETURN returnsum The GOOD solution margin check total group VIRTUAL = var vtab2 = ADDCOLUMNS(SUMMARIZE(SalesTable, SalesTable[Customer]), "code",[Margin check code]) VAR selectedcode = SELECTEDVALUE(MarginRange[Code]) VAR returnsum = CALCULATE( COUNTX(vtab2,[code]), FILTER(vtab2,[code] = selectedcode) ) RETURN returnsum And here are my questions. It would be really great to get a better understanding of the solution 1. Why you do not need the TREATAS function? As there is no relationship between the range table and the support/virtual table, I was thinking I need to build one. 2. Why the a virtual table cannot be used with FILTER (VALUES ... () ) 3. Which piece of DAX maked the total work? I really appreciate some insights to understand DAX better and why this solution works comparing to mine. Big thanks to the community ERDSolved2.4KViews0likes4CommentsIF value exists on calendar date
Hi everyone, i need help creating a measure that evaluates whether a value in on table exists at a particular date within the calender table . I am working with Two tables, on main table that has a customer and a purchase date. The second table is just a table showing the daily calendar dates. the outcome wanted is to evaluate whether a purchase was made by a customer at a certain date on the daily calender. the tables are as shown below : RESULT If a customer has purchased something on the date equivalent to the calendar date, return true, else false. as shown below: If anyone could assist me with writing a measure that could produce this outcome that would be wonderful 🙂 all help and sugegestions are welcome: Thank youSolved2.4KViews0likes6Commentssum values of a list of unique values
Hello, I'm having trouble displaying a list of unique values for a second line of code that sum only the Lbs of values in that list, here is my code: Total LT = VAR list = CALCULATE(VALUES('DATA BASE'[OP]),'DATA BASE'[EE] = "LT") RETURN CALCULATE(SUM('DATA BASE'[Lbs]),'DATA BASE'[OP]=list) here's a example of my data base (is a lot more bigger): i want the list of the OP's that has some value in EE = LT, for later sum the total Lbs of that OP ThanksSolved1.9KViews0likes4Comments