dax calculation
4 TopicsCALCULATE function does not filter data
I am trying to use the CALCULATE function in DAX to find sum of income in last 12 months. The measure I am using is as below Sub measures Latest Month in Table = MAX(pbi_inc[yymm]) Samemonth_prev year = [Latest Month in Table] -100 Main DAX: income_inc= var lm = [Latest Month in Table] var r12m = [ Samemonth_prev year] return CALCULATE(SUM(pbi_inc[inc], pbi_inc[ic/cr] =1,pbi_inc[yymm] >=lm , pbi_inc[yymm] <=r12m) The issue I am facing is the Calculate function is not filtering data for yymm. It filters data when I change the ic/cr value but not for yymm. It works fine when I hardcode to something like 2112 but not when I use variables and submeasures. I have compared the data types and spaces and all are compatible. All fields are taken from the same fact table Can some one please help me?Solved2.2KViews0likes2CommentsSumifs in power bi
Hey, I have I believe a pretty simple request, I unfortunately cannot seem to figure it out. For the below table created from my dataset set I want to count for each unique order nr determine how many items were purchased total. However everytime I do a formula where Line qty is greater than 1 it returns orders which have a line qty of the value of 2 rather than the sum. Example: order 10000 has 3 unique items with a line quantity of 1 for a sum total of 3. while another order has 1 unique item with a line qty of 2 for a sum total of 2. The below formula keep returning the latter condition and not the former. Sum if line quantity = CALCULATE(SUM(FACT_Orders[Line QTY]),DISTINCT(FACT_Orders[Order Nr]))Solved1.7KViews0likes5CommentsLast week today - last year drill down to day results
Hei, I hope you can help me. I need to create a measure that brings data per day for Last week - last year. So far I've managed to bring data per week with this measure: LWTD LY := VAR CurrentWeek = MAX(Time[WeekNr]) VAR CurrentYear = MAX (Time[Year]) VAR PriorYear = IF(CurrentWeek =1, CurrentYear-1, CurrentYear) VAR PriorWeek = IF(CurrentWeek=1, CALCULATE( MAX(Time[WeekNr]),ALL(Time), Time[Year]=PriorYear),CurrentWeek-1) RETURN CALCULATE([Sales],ALL(Time), Time[Year]=PriorYear, Time[WeekNr]=PriorWeek) This gives me the following results where the totals of the week sums are correct. However what I need is to bring data per date, not only the total of the week. How can I achieve this?Solved804Views0likes1CommentDAX expression using specific field
Hi Everyone, Please help me to write expression in DAX. My current expression is Sum( Value) . I want to display the value based on specific field Response Type. For ex: 1.If Responsetype is ###,###,###,##0.0% then value would be 104,336.8% 2. If Responsetype is ###,###,###,##0 then Value is 10,972 (without percentage) Response Type ###,###,###,##0 ###,###,###,##0% ###,###,###,##0.0 ###,###,###,##0.0% ###,###,###,##0.00 ###,###,###,##0.00% $###,###,###,##0 $###,###,###,##0.00 Thanks in advanceSolved1.6KViews0likes4Comments