filter using a measure
8 TopicsCustom Measure not working on Pie Chart Visual
Hello Team/ Uspace87 , I have created a custom measure , which I want to use as a filter in pie chart visual. When I apply this filter , it gets applied on the "Legend" but not on the "Values" of the pie chart visual. Please assist. My exact use case is as follows : 1.The default behaviour of the checkbox slicer in Power BI is that it shows the result of OR when you select multiple items , I wanted to convert checkbox slicer to AND logic upon multiple selection. 2. I took the help of following link to create a custom measure : https://radacad.com/slicer-with-and-condition-in-power-bi 3. The custom measure is working correctly on table visual but when I try to use the same on pie chart I am facing the abovementioned issue. Please suggest if not custom measure then what is the correct way to solve my use case. Thanks Deesha576Views0likes0CommentsConditional formatting via isinscope()
Hi All, Via a measure and the function isinscope() I assigned conditinal formatting on 3 different hierarchical levels (matrix rows). This working just fine, but the business wants to have a button where they can filter based on the numbers which are red. The problem is now that when the third hierarchical level is red a filter on the color code does not return all 3 hierarchical levels. Is there a function where you can overwrite these levels? So you can say that when isinscope(Level 2) level 1 is returend, but also level 3. Measure conditonal formatting: IF (ISINSCOPE(hierarchical [level 3]),blank(), IF (ISINSCOPE(hierarchical [level 2])&&([Difference %])>varLevel2%),"#ff2000", IF (ISINSCOPE(hierarchical [level 1])&&([Difference %])>varLevel1%),"#ff2000"))) The sample PBIX is on this wetransfer link: https://we.tl/t-9TvD36eFPPSolved3.9KViews0likes9CommentsSlicer of a measure based on whether it is greater than zero or not
Hi, i have a model with several fact tables (such as orders, sales etc.). my main pivot fact table is customers. i have built some measures calculating sum of sales/orders/etc in the last X months (X is being selected as a parameter by the user in a dedicated slicer). i have a table visual of customers (row per customer) and in columns there are all the measures i mentioned above. my aim is adding slicers as number of measures above which simply filter the table by --measure is greater than zero or not-- (true/false) and of course change the count of customers' card visual accordingly. i hope its clear. thanks in advance, Amit858Views0likes3CommentsDAX Filtering with multiple measures
I have created some statistical measure for lower bound, quartile 1, median, quartile 3, and upper bound. I would like to have a count of the records that lay between these boudaries. So, as an example, I created this: COUNTROWS(FILTER(TechData, TechData[VALUE] >= TechData[Lower Bound] && TechData[AcceptanceTime] < Quartile1)) This returns a blank value. I've discovered that if I put the actual value into the second part of the &&, I get the correct response. So, this works: COUNTROWS(FILTER(TechData, TechData[VALUE] >= TechData[Lower Bound] && TechData[AcceptanceTime] < 20)) Any ideas why it can process the first measure, but seems to have issues when the second is added?Solved577Views0likes1CommentPower BI Report Builder / DAX-Studio dimension and fakt Filter not working as exptected
Hello, I am wondering why filtering in Dax no working as ecpected. Neither in Dax Studio nor in Power Bi Report Builder with genrated code by the wizard. Datamodel: I use a shared Power-Bi Dataset that is imported from SQL. The model is basically a star-Schema. Fact table in the middle aber dimensions like customer , company, sales or date. Linked by ID and bidirectional. Dimension tables customer company sales date The fact table sales quantity sales value cacaluated Measures sales value in EUR Problem 1: Filtering dimension by an other dimension if I create a dataset with the wizard, where I only display dimension "sales- sales ID" and set a Filter/Parameter "customer - name" to a specific customer (0011260), the salesid are not filtered by the specificy customer. It shows all salesids. Result in report builder: Code: EVALUATE SUMMARIZECOLUMNS('Umsatz Dim Auftrag'[salesid], RSCustomDaxFilter(@UmsatzDimKundeKundennummer,EqualToCondition,[Umsatz Dim Kunde].[customer],String)) Expected Result: Why filtering not working right? my workaround is to add a countrows fact table or any other calculated measure. But I think this cannot be a real solution. Problem 2: Aggregation fact not calculated measures if i create a Dataset with the wizard or event in Dax-Studio Dimension sales - salesid fact quantity count rows because of problem 1 filter: 1 salesid = 395A0000203 Result: Code: /* START QUERY BUILDER */ EVALUATE SUMMARIZECOLUMNS( 'Umsatz Dim Auftrag'[salesid] , 'Umsatz - Fakten'[qty], KEEPFILTERS( TREATAS( {"395A0000203"}, 'Umsatz Dim Auftrag'[salesid] )) , "CountRows-Fact", CALCULATE(COUNTROWS('Umsatz - Fakten')) ) /* END QUERY BUILDER */ Expected result: Code: EVALUATE SUMMARIZECOLUMNS( 'Umsatz Dim Auftrag'[salesid] , KEEPFILTERS( TREATAS( {"395A0000203"}, 'Umsatz Dim Auftrag'[salesid] )) , "SUM_QTY", sum('Umsatz - Fakten'[qty]) , "CountRows-Fact", CALCULATE(COUNTROWS('Umsatz - Fakten')) ) Why do i have to specify the aggregation again in the code? I specified my fact - qty already in Power Bi as summarize by Sum. When i create the fact as measure it surely works. But for this i have to create a simple sum measure for all my measures. greetings BenediktSolved1.4KViews0likes3CommentsAvoid adapting a measure in a table, and IF() returning too many rows
Hi everyone, Here's a WeTransfer for the PBI in case you want to help me: https://we.tl/t-sfdijb0Q4Y I have 3 tables, linked together in the follwoing way: So far, for a selected Category (selected with a slicer on the category's name), I display all the information that I have in the Table Feuil2 and the sum of Value from Feuil3. In addition, I computed a weighted average of the Value for each attribute in the selected category, weighted by their sales. For this, I used the following DAX formula: average_value_weighted_by_sales = DIVIDE( SUMX(Feuil3, Feuil3[Value] * CALCULATE(SUM(Feuil2[AttributeSales])) ), CALCULATE(SUM(Feuil2[AttributeSales])) ) My Power BI looks like that: What I would like to do it add a column to the Table visual that would take the value "OK" if the sum of an attribute's value is smaller than the displayed average_value_weighted_by_sales, or "KO" if the sum is greater. In my example, that'd mean that I'd have "KO" for the first row (since 1.94383 > 1.81081), "OK" for the second row (since 1.51867 <= 1.81081), and "KO" for the last row (since 2.2050 > 1.81081). Of course, I would need this to be dynamic when we select a new category. While doing to do this, I have faced two problems: The measure that I created adapts to the context (I guess that's the name?), meaning that if for an attribute I ask how its value compares to the measure, it's always equal since the measure wil be computed based on the attribute only. We can see that by placing the measure in the visual and we will see that the columns Value and average_value_weighted_by_sales will be equal. Th function IF (which I think is the next step) returns all the rows and not only the ones I filtered with the slicer. Thank you for you help!Solved1.7KViews0likes6Commentscreate new table using a measure as a filter
I have two tables Table 1 and Table2 which are unrelated, and by using a measure which I build up from a selection of values from Table1, I want to build a 3rd table which is a subset, ie a filter, of Table2. Here's the measure I create from Table1. (you can ignore the hardcoded result R2 for now) Selected name = VAR R1 = SELECTEDVALUE(Table1[Column1]) VAR R2 = "Rashi" RETURN R1 Then I create Table3 from Table2 Table3 = FILTER(Table2, Table2[Name] = Table1[Selected name]) This results in Table3 with zero rows. However, if I change my measure to use the hardcoded result, eg Selected name = VAR R1 = SELECTEDVALUE(Table1[Column1]) VAR R2 = "Rashi" RETURN R2 then Table3 is created with a single row, which is what I want. How do I go about creating the table using the variable R1 in the measure, what is the difference between returning the values R1 and R2 - I've done some tests and can see no difference. An example PBI file is attached here. Thanks in advance.1.2KViews0likes5Comments