time intellegence
2 TopicsWant to Calculate Maximum Revenue as per InScope Dax
I have used multiple sources and posts from this forum to solve this, but, unfortunately I can't figure it out. Hope somebody can help me! I have created a line chart where I placed Date Hierarchy on the X-axis, which contains Year, Quarter, and Month. Now, I want a DAX to calculate the maximum Revenue value at each level- Year, Quarter, Month: At the Year level, it should calculate the highest Revenue value among all years (2020,2021,2022). At the Quarter level, it should calculate the highest Revenue value within all quarters of a specific year or all years (Drill Down). At the Month level, it should calculate the highest Revenue value within all months. I have written the code below for this, but it is not working as expected. It only works at the Month level; it does not work at the Year and Quarter levels. Max Height 1 = SWITCH(TRUE(), ISINSCOPE('Calendar Lookup'[Date].[Month]) || ISINSCOPE('Calendar Lookup'[Date].[MonthNo]), MAXX(ALLSELECTED( 'Calendar Lookup'[Date].[Year], 'Calendar Lookup'[Date].[Quarter], 'Calendar Lookup'[Date].[QuarterNo], 'Calendar Lookup'[Date].[Month], 'Calendar Lookup'[Date].[MonthNo] ), [TOTAL REVENUE] ), ISINSCOPE('Calendar Lookup'[Date].[Quarter]) || ISINSCOPE('Calendar Lookup'[Date].[QuarterNo]), MAXX(ALLSELECTED( 'Calendar Lookup'[Date].[Year], 'Calendar Lookup'[Date].[Quarter], 'Calendar Lookup'[Date].[QuarterNo] ), [TOTAL REVENUE] ), MAXX(ALLSELECTED('Calendar Lookup'[Date].[Year]), [TOTAL REVENUE] ) )Solved69Views0likes9CommentsSort out preset time periods
Hi, I have an issue trying to set up a slicer for preset time periods like "Last 24 hours", "Last 48 hours" and "Last 1 week". When pressing the diffrent time periods I want all of the data to show for that period. But since I'm using a calculated column that converts the date/time column to "24h", "48h" and "1w", it only show the 48-24 when pressing "48h". How can I make it so all data is included? All help and tips are appreciated 🙂Solved571Views0likes1Comment