dax variable
5 TopicsNeed to RETURN all variables in DAX query for single column in matrix
Hello, I have scoured these forums for what seems like an easy solution, and I very well still might be missing something, but I haven't been able to find my answer. Basically, I have a DAX query that's going to contain several VARs and I need to RETURN all of them. No filters, conditions, etc. My current DAX measure: Categories = VAR _particCount = CALCULATE( DISTINCTCOUNT('part month end info'[Part Tax ID]), FILTER( 'part month end info', 'part month end info'[Part Month End Bal] > 0 ) ) VAR _planUnder1 = CALCULATE( DISTINCTCOUNT( 'plan info - sql'[Plan ID]), FILTER( 'plan info - sql', 'plan info - sql'[Plan Month End Balance] > 0 && 'plan info - sql'[Plan Month End Balance] < 1000000 ) ) VAR _planUnder3 = CALCULATE( DISTINCTCOUNT('plan info - sql'[Plan ID]), FILTER( 'plan info - sql', 'plan info - sql'[Plan Month End Balance] >= 1000000 && 'plan info - sql'[Plan Month End Balance] < 3000000 ) ) RETURN **I want to return all the above variables** I've tried using MAX(_particCount, _planUnder1) but I can only list two arguments here. I'm going to have 10-15 variables tops to all show in a matrix 'column' (measure will actually go in Values section in Build pane). Here's a pic of what I get with the two variables returned, I need all the variables returned (the bolded items are main categories in a 'Row Categories' table)1.8KViews0likes4CommentsSlicer doesn't work for table which is created in variable
Hi, I'm trying to create a new table for some specific date periods and percentage changes for some of them. I used calculated column for deposit and brought measures per row. It looks like as below, The issue is that, country- brand and brandsplit slicers don't affect the table. How can I adjust my table "_table1" as variable? The measure for yesterday, Thank you, VK645Views0likes4CommentsDAX query for alternative of what if parameters
Hi Guys! I'm encountering an problem in which i want to acheive what if parameters functionality because i'm using Report server and it won't work on RS , i need to use same working like pattern , now if i want to get all the values of a column in a measure how can i do it just like SQL query in which e.g select col1 from tab1; i want to achieve same thing in daxSolved954Views2likes3CommentsDAX/PowerBI Rank taking a varable/parameter into account
Hi, I'm working on a ranking/scoring system and I'm missing the "PERCENTRANK.INC" function in powerBI. Instead I received great input on this formula which is the closest I can get. Score = DIVIDE ( RANKX ( FILTER ( 'Table', NOT ( ISBLANK ( [Sold amounts] ) ) ), [Sold amounts], , ASC ) - 1, COUNTROWS ( FILTER ( 'Table', NOT ( ISBLANK ( [Sold amounts] ) ) ) ) - 1 ) I really want to have the formula to take the type of "Fruit" into account in my scoring/ranking. In short each fruit should be scored seperately, with a range per fruit sold. Could this somewho be done with a variable (VAR)? Example of data:Solved487Views0likes1CommentConditionally assign union in Dax tabular model
Hi Team, I've created two variables with different conditions below. (T1 and T2 ) I need to do union based on some condition in ssas tabular not in power bi. example: if(condition="no approve",union(T1,T2),otherwise will return only T1) I tried below quey but error like: The expression specified in the query is not a valid table expression. Can you help me on this? Query DEFINE VAR T1 = SUMMARIZECOLUMNS ( sl[status], sl[desc] ) VAR T2 = SUMMARIZECOLUMNS ( sp[SpStatus], sp[desc] FILTER ( sp, sp[SpStatus] IN { "no approve" }) ) VAR union_T1_T2 = UNION ( T1, T2) var gl=IF(VALUES(sp[SpStatus])="no approve", union_T1_T2, T1) EVALUATE glSolved1.6KViews0likes2Comments