reports
8 TopicsIncorrect result when using multiple similar measures with TREATAS and variables in the same visual.
When two measures that have a very similar looking but different calculation both use TREATAS with a variable as the first TREATAS parameter and are used in the same visual the output of one of the measures will incorrectly be a duplicate of the output of the other measure. This looks like an incorrectly applied DAX fusion optimization, which measure output gets duplicated seem to depend on which measure you add to the visual first. This is what the output should look like: Here is the incorrect output: Here is the DAX code of the two measures: Here is the data from the simple 2 table data model used to demonstrate the problem. I can provide a PBIX file that demonstrates the problem if needed.962Views0likes5CommentsThe expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
Hello Guys, could you please help me to solve this issue of the "multiple columns cannot be converted to scalar value" iam using the below DAx formula: MTD/QTD/YTD = VAR todayDate = TODAY() VAR YearStart = CALCULATE(STARTOFYEAR('ACT - BGT'[Postg Date]), YEAR('ACT - BGT'[Postg Date])=YEAR(todayDate) ) VAR QuarterStar = CALCULATE(STARTOFQUARTER('ACT - BGT'[Postg Date]), YEAR('ACT - BGT'[Postg Date]) = YEAR(todayDate), QUARTER('ACT - BGT'[Postg Date]) = QUARTER(todayDate) ) VAR MonthStart = CALCULATE(STARTOFMONTH('ACT - BGT'[Postg Date]), YEAR('Calendar'[Date])= YEAR(todayDate), MONTH('ACT - BGT'[Postg Date]) = MONTH(todayDate) ) VAR Result = UNION( ADDCOLUMNS ( CALENDAR(YearStart,todayDate), "selection", "YTD" ), ADDCOLUMNS ( CALENDAR(QuarterStar,todayDate), "selection","QTD" ), ADDCOLUMNS( CALENDAR(MonthStart,todayDate), "selection", "MTD" ) ) RETURN ResultSolved1.9KViews0likes1CommentCannot hide two dynamic reference lines on same chart
If you have two dynamic reference lines on the same chart if you use a multi-select field parameter then you can uncheck to hide one reference line, but unchecking the second one causes the value to be set to 0 and not blank and it will still show on the chart. LOD reference line = VAR _RawSignalSelected = IF(SELECTEDVALUE('Indicator parameter'[Indicators])="'Measures Table'[Raw 7-day moving average]",TRUE(),FALSE()) VAR _SelectedRefLine = IF("'Limits of quantification and detection by disease'[Limit of detection (LOD)]" IN ALLSELECTED('Reference lines'[Reference lines Fields]) && ISFILTERED(('Reference lines'[Reference lines Fields])) = TRUE(),TRUE(),FALSE()) VAR _LOD = CALCULATE(MAX('Limits of quantification and detection by disease'[Limit of detection (LOD)])) RETURN IF(_RawSignalSelected && _SelectedRefLine,_LOD,BLANK()) LOQ reference line = VAR _RawSignalSelected = IF(SELECTEDVALUE('Indicator parameter'[Indicators])="'Measures Table'[Raw 7-day moving average]",TRUE(),FALSE()) VAR _SelectedRefLine = IF("'Limits of quantification and detection by disease'[Limit of quantification (LOQ)]" IN ALLSELECTED('Reference lines'[Reference lines Fields]) && ISFILTERED(('Reference lines'[Reference lines Fields])) = TRUE(),TRUE(),FALSE()) VAR _LOQ = CALCULATE(MAX('Limits of quantification and detection by disease'[Limit of quantification (LOQ)])) RETURN IF(_RawSignalSelected && _SelectedRefLine,_LOQ,BLANK())461Views0likes1CommentHow can I make it return 0 instead of false
HI guys I have issues with the equation im looking at, Right now I have made a custom column with an equation like this = if [Document Type] = "IN" then [original Document Amount] else [Original Document] = 0 Any help is appreciated!Solved483Views0likes1CommentCurrent Year vs Last Year by Item
Hi I am Struggling to write a measure to compare Last Year vs This Year by Item. Firstly the years is not dates but text 2021 and 2022 and i cannot use dates because i would need to break it down further into financial months which is fiscal periods not dates, eg 1,2,3 .....12. By selecting the year from a slicer to compare the selected year to prior year it omits the product that was discontinued and had sales in prior year but not in current year The Table is Year Product Amount 2021 Current Product 10000 2021 Discontinued Product 20000 2022 Current Product 30000 2022 New Product 40000 The Visual i want : Product Selected Year Prior Year Current Product 30000 10000 New Product 40000 0 Discontinued Product 0 20000 TOTAL 70000 30000 The Visual i get: Product Selected Year Prior Year Current Product 30000 10000 New Product 40000 0 TOTAL 70000 30000 Selected year measure = sum(sales[Amount]) Prior year measure = = CALCULATE(sum(sales[Amount]),sales[Year]="2021") I am obviously missing something. Regards JoseSolved581Views0likes2CommentsWhy doesn't REMOVEFILTERS work?
I have a simple formula that calculates the incident count per month, which is then broken down by our defined week of the month (all months have W1, W2, W3, & W4). Works great. Avg Count per month = 'Incident Measures'[_Inc Count] / [_Count of Months] The problem is I need this to calculate the counts while ignoring the date slicer on the page. I've tried using REMOVEFILTERS and ALL and nothing has worked: Avg Count per month - All months = CALCULATE('Incident Measures'[_Inc Count] / [_Count of Months], REMOVEFILTERS('DATE Table'[Year Month Name])) where "Year Month Name" is the column from the related date table that is the date slicer. I have been fighting this for 3 days and am no closer to a solution. Note: I cannot use Edit Interactions because the data is actually going into a cluster chart with other data that does need to be affected by the slicer.755Views0likes3Comments