dax function
15 TopicsGet lookup values based on multiple conditions
Hello, I have an excel file with two sheets called Data and MF. S.NONew : =IF(OR(D2="#";D2="NULL");C2;D2) CombinedValue: = B2&A2&E2 (concatenation of ID ,IDNew, S.NONew) Rep: = IFERROR(IF(OR(G2="BLANK";G2="CN";G2="PERSON OR COMPANY'S NAME");VLOOKUP(B2;MF!A:B;2;FALSE);VLOOKUP(A2;MF!A:B;2;FALSE));"UNASSIGNED") I want to implement the S.NoNew, CombinedValue and Rep columns in Power BI desktop instead of in Excel. I imported the data into Power BI and i created S.NoNew and CombinedValue columns but it would be great if someone can help in creating the Rep column in Power BI. Regards, Krishna.5.2KViews0likes3CommentsSQL to DAX conversion
I am trying to get the equivalent logic in DAX for below SQL declare @date datetime declare @warehouse nvarchar(225) declare @province nvarchar(225) set @Transdate = '2021-09-18 00:00:00.000' set @province = 'BC' set @warehouse = 'BC-01' ----- THIS CTE RANKS THE ITEMS TO GET THE MOST RECENT category ----------- with main1 as ( SELECT * , ROW_NUMBER() OVER(Partition by itemid, warehouseid ORDER BY transdate DESC) AS rn FROM [EDW].[FACT].[InventoryBalancedet_2] dt WHERE province = @province and warehouseid = @warehouse and transdate <= @Transdate ), ------ THIS CTE RANKS amount of an item by warehouse ----------- main2 as ( select sum(Amount) as AMOUNT , ItemID ,warehouseid FROM [EDW].[FACT].[InventoryBalancedet_2] WHERE province = @province and warehouseid = @warehouse and transdate <= @Transdate group by ItemID , warehouseid ), ------------ COMBINING THE QUERIES TOGETHER -------------------- main3 as ( SELECT m2.AMOUNT, m2.warehouseid , m1.Category FROM main1 m1 inner join main2 m2 on m1.warehouseid = m2.warehouseid and m1.ItemID = m2.ItemID and m1.rn = 1 ) select sum(m3.total) ,m3.Category FROM main3 m3 group by m3.CategorySolved4.7KViews0likes10CommentsCounting ELA and MATH
I have an issue and am having trouble wrapping my head around it. I am trying to count students absent in English and Math classes. The issue here is the database places students absent per period on a row to row basis. I have created a sample here. The original one is over a million rows. I was wondering if there is any way I can create a column that counts number of students absent in MATH and ELA. I know I can do table. But I need to be looking more like the picture below (red font is where I want the calculation) and was wondering if someone could help.Solved3.9KViews0likes12CommentsAllow audience introduce goal manually for any measure they select
Does exists a way to manually enter a goal in power bi? where the audience can introduce the value. I am not a frequent user of Dax but I will apreciate some guide if this can be achieve or it need to be done under very specific Power bi feature. I am looking to do under power bi desktop. The external measure goal introduce may vary depending the type of goal cuz could be in percentage or integer number format. thanks in advanceSolved3.3KViews0likes10CommentsTake the latest value in a subcategory and roll it up to category
Hi Team I have a table which has Month Cat SubCat. value Aug. A. B. 10 Aug. A. B. 12. —— latest Aug. A. C. 13. —— latest Sep. A. B. 15 —— latest sep. E. D. 30. - latest In this at subcat level I want to take the latest value at Month level. For this I created a index col and a simple measure Works at subcat level calculate(sum(value),index = a) # a = max(index) But the same measure doesn’t work at Cat level as it will take the max of index at cat leve but what I need is at cat level it will sum the underlying sub cats latest values. So for Aug for Cat A it should he 12+13 = 25 but the current measure gives 13. Sep for A is 15 etc. Help needed!Solved2.2KViews0likes2CommentsIs possible to show One Metric with details and rest simple by using Dax functions ?
Hello, I need to show measures dynamically in Grid or Matrix visual, I have a set of data with over 20+ Metrics precalculate in SQL. Those measures come from different Fact tables and it is with tabular data. Based on from audience request I am looking to see if can be possible to do this: Using Dynamic Slicer show in the front one measure with some extra analisis (frame in blue) then keep showing the rest of the other measures simple as thier value come. I am be able to change dynamically the blue frame but I wondering if it is possible to show the rest of the measures. I am looking to do it in DAX but let please know if this can be done under Dax or under Query Editor but my preference is under dax. For example from the slicer metric selection I choose metric A. This one show all the details related variance, vol, vol% , impact, etc. but then rest of the metrics not select show next the metric selected it. Then if Metric B is select show the details and rest of the metrics simple.(metric b is back wit rest of the metrics) If the Metric c is select the that change in the blue frame and now metric B and metric A are back wit the rest of the metrics Apprecite your advice and guide.2.1KViews0likes5CommentsAdding values on the same row from different columns
Hey guys, I'm just wondering if anyone can help me to solve what seems like a simple addition problem. I currently have two columns: - status update values (1-3) - Objective values (4-10) Ideally, in a new column, I would like to add both sets of values on the same row (i.e. Status update value + Objective values = total score) Would anyone happen to know the DAX formula for such an equation? Any help is much appreciated! Cheers, B1.5KViews0likes1CommentNew column
Hello guys, I'm trying to create a column where a list of customer numbers is related to the customer name, but I can't add more than 3 argument for the function below. All the numbers below should give "John Lewis" as answer. Can anyone help me out? Cheers!Solved1.4KViews0likes6CommentsHelp for Maxx dax function error
Hi, I am trying to get Max of fee rate for each stream. I want to get the result as desired max fee highligted in yellow as shown in the table below. I tried this dax calculation: Desired max fee = MAXX(VALUES('Session Budget Tracker'[Stream]),CALCULATE(MAX('Session Budget Tracker'[Session Fee ($)]),ALLEXCEPT('Session Budget Tracker','Session Budget Tracker'[Stream]))) Can anyone help me to get the correct values please. Kind Regards, ThiliniSolved1.3KViews0likes3Comments