measure
9 TopicsHow to fix Date X Axis?
Hello! To give context I am trying to count the number of transactions done in established periods such as (Actual month or Past month). For this, I used calculated measures: Actual Month = VAR EARLIESTYEAR = YEAR(MAX(Transaccional[Date])) VAR EARLIESTMONTH = MONTH(MAX(Transaccional[Date])) VAR EARLIESTDAY = DAY(MAX(Transaccional[Date])) RETURN CALCULATE(count(Transaccional[TransactionId]), FILTER(Transaccional, YEAR([Date])=EARLIESTYEAR && MONTH([Date])=EARLIESTMONTH && DAY([Date])<=EARLIESTDAY )) Interanual Month = CALCULATE( count(Transaccional[TransactionId]), FILTER(Transaccional, YEAR([Date])=YEAR(MAX([Date]))-1 && MONTH([Date])= MONTH(MAX([Date])) && if(MAX([Date])<>EOMONTH(MAX([Date]),0),Day(Transaccional[Date])<=DAY(MAX([Date])) ,DAY([Date])>=DAY(MAX([Date])) || DAY([Date])<=DAY(MAX([Date]))) )) Previous month = CALCULATE( count(Transaccional[TransactionId]), FILTER(Transaccional, YEAR([Date])=YEAR(MAX([Date])) && MONTH([Date])= MONTH(MAX([Date]))-1 && if(MAX([Date])<>EOMONTH(MAX([Date]),0),Day(Transaccional[Date])<=DAY(MAX([Date])) ,DAY([Date])>=DAY(MAX([Date])) || DAY([Date])<=DAY(MAX([Date]))) )) The purpose of this formula is to make the data visualization dynamic since I want the user to filter the data, and depending on those changes I want the graph to change. I am certain that the formulas work just fine. Still, when I have to graph the measures, the X axis corresponding to the date (specifically DAY), the numbers are wrongly distributed along the X axis. For example: The latest date on this data is (6/19/2024) but the measure shows values up to day 30, which means that the data is not well aligned. I have tried and thought this a lot but don't know what the solution would be.550Views0likes2CommentsIf date value is not blank return date value if date value is blank return "Text"
Hello I need a measure for a card visual to display a date value if present however if it's blank display a custom text such as "NONE" The date field(expectedresultdate) is a data type of "Date". The custom text if the field is blank is just "Text". Heres what I have. next update = IF(ISBLANK(SELECTEDVALUE('Annual Metrics'[ExpectedResultDate])),SELECTEDVALUE('Annual Metrics'[ExpectedResultDate],"NONE"),SELECTEDVALUE('Annual Metrics'[ExpectedResultDate])) Thank you,Solved1.4KViews0likes5CommentsPower BI Report Builder Query 'explodes' after adding measure
Hi all, If have a report builder report that uses a query on a SSAS Tabular cube. All works fine, until I add a new measure. When I add this new measure all memory is used and the report crashes. The measure works in power bi like in this table : The measure (for example) #ArrivedLate is a count of all the rows having the the value 'Late' in a calculated column of the SSAS model. And the calculated column is a formule based on several time registrations. All I want to do is recreate the table using the same measures, like this : The column NumberOfTransports is a measure in the SSAS Tabular model as well, but this is a simple count formula. Same goes for the measure avgTimeOnTerminal, TotalLoadingTIme, TotalTimeOnTerminal which are all simple calculations. So why does my query explode and use all memory when I add the measure #ArrivedEarly ? Thanks in advance. Jacco504Views0likes0CommentsFilter Matrix Table by Relative Value to DAX Dynamic Date Rank Measure
Hi All, I have successfully created a RANK measure (DateRank) thanks to powerBI forum that will dynamically adjust with slicer selections. I must now create a table that will respond relative to that Rank, specifically, MIN(DateRank)+1 or DateRank = 2. DateRank = MINX ( FILTER ( SELECTCOLUMNS ( ALLSELECTED ( 'Table' ), "index", 'Table'[Index], "rank", RANKX ( ALLSELECTED ( 'Table' ), 'Table'[Report_Date],, DESC, DENSE ) ), [index] = MAX ( [index] ) ), [rank] ) This is due to a report which will only run certain days of the week (not weekends). Report_Date corresponds to the report output of the specified date, and when selecting a Report_Date through a slicer, we would like to affect two tables: one which displays selected Report_Date PV (present value) and one that displays the immediately preceeding Report_Date PV. For the supplied PBI data, when 12/14/21 is selected on the filter, the "Selected Date" table will display PV as of 12/14/21, and the "Previous Date" table will display PV as of 12/14/21. Using the DateRank measure, I have tried to filter "Previous Date" on DateRank = 2 using Filter pane, and also a measure [PV_Yesterday] where DateRank = 2, but niether are working. I would prefer to Filter on DateRank = 2 or an equivalent solution, but if new measure is required like [PV_Yesterday] instead of a visual filter, then I am open to that. Thank you for considering this problem! Report_Date REGION PV 10/25/2021 12:00:00 AM MID-WEST -1584657.012 10/25/2021 12:00:00 AM NORTH-EAST 47711338.72 10/25/2021 12:00:00 AM SOUTH-EAST 0 12/14/2021 12:00:00 AM SOUTH-EAST 0 11/10/2021 12:00:00 AM NORTH-EAST -2920107.499 11/10/2021 12:00:00 AM MID-WEST 0 11/29/2021 12:00:00 AM NORTH-EAST -15895241.11 12/6/2021 12:00:00 AM MID-WEST 0 12/9/2021 12:00:00 AM MID-WEST 0 11/11/2021 12:00:00 AM NORTH-EAST 0 11/11/2021 12:00:00 AM MID-WEST 0 12/8/2021 12:00:00 AM NORTH-EAST 2.015367962 12/1/2021 12:00:00 AM NORTH-EAST 0 11/17/2021 12:00:00 AM NORTH-EAST 0 11/1/2021 12:00:00 AM NORTH-EAST -1160.720229 10/28/2021 12:00:00 AM NORTH-EAST 0 11/5/2021 12:00:00 AM NORTH-EAST -1033717.772 11/23/2021 12:00:00 AM MID-WEST 0 11/23/2021 12:00:00 AM NORTH-EAST 134.1285225 11/8/2021 12:00:00 AM NORTH-EAST 0 11/22/2021 12:00:00 AM MID-WEST 0 11/19/2021 12:00:00 AM NORTH-EAST -798412.6336 11/19/2021 12:00:00 AM SOUTH-EAST 0 11/16/2021 12:00:00 AM MID-WEST 0 11/15/2021 12:00:00 AM MID-WEST 0 11/12/2021 12:00:00 AM NORTH-EAST 0 11/12/2021 12:00:00 AM MID-WEST 0 11/9/2021 12:00:00 AM NORTH-EAST 2.193014276 12/14/2021 12:00:00 AM NORTH-EAST -11874298.76 11/19/2021 12:00:00 AM MID-WEST 0 11/10/2021 12:00:00 AM SOUTH-EAST 0 11/16/2021 12:00:00 AM NORTH-EAST -140.1228899Solved712Views0likes1CommentI am trying to do an If/Then referencing another row
Expanded explanation-- In this data I want to do something like: if team on row a = team on row b and end of week on row a = end of week on row b - 7 then put the net change amount from row a into a field named 'running total' on row b I am trying to write the following: If the field PriorWeek in this row equals the EndDate in another row, put in the NetAmount from the other row as PriorAmount. ie: if the Net Amount for 5/1/20 is 50, put that as PriorAmount in the row for 5/8/20644Views0likes1CommentCurrent year vs Previous year line chart failure
Hello, When I try to make a line chart of the previous and current year using the meassure Previous year Amount = CALCULATE([Amount], DATEADD('CalendarDay'[Date],-12,MONTH)) (Current year) Amount - (SUM('Table'[Price])) I get ithe same data as for the current year, if I apply the measure Previous year Amount =CALCULATE([Amount],ALL('Table1'[Year]), DATEADD('CalendarDay'[Date],-12,MONTH)) it shows me the sum of all the previous years. Any idea why? PS. im using Directquery mode719Views1like0CommentsFetching column names from table
Hi All, wanted to fetch all the column names from a particular table, either as a row in that same table or as a measure. I was hoping to have all the column names as a selectable value in the table, rather than just a heading. Also if possible somehow have a table rows and coulmns interchanged as in transposing them. Thank you828Views0likes0CommentsSome dax functions does not work on PBRS
Hi all; Some functions does not work like dateadd,totalmtd,totalytd etc. in direct query mode And I wanna say everthing works at Power BI Desktop RS .The problem starts when I published to the Power BI Report Server. Also marked "Allow unrestricted measures in Direct query mode" Im getting MdxScript(Model) (19, 33) Function 'DATESMTD' is not supported in DirectQuery mode. MdxScript(Model) (13, 4) Function 'DATEADD' is not supported in DirectQuery mode. etc. errors. Which dax functions are working on Power BI Report Server?Is there any list of them? Thank you.Solved7.5KViews0likes6Comments