Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
New to Power BI, so I wanted to know if there is a way to dynamically create a line chart showing the past 6 months of my data.
In my data I have a "month_year" column, and to retrieve the current month everytime, so that I don't have to filter into the new date, I created a measure
Max Month = CALCULATE(max(Table1[month_year]), all(Table1)) and then created a new column
Latest = if(Table1[month_year]=[Max Month],"Curent Month","")
Now I can show the last 6 months easily by creating a hierarchy with month_year and filtering in the 6 month dates, but is there a formula I can use to dynamically display the last 6 months
data is suppose to just show the revenue growth for 6 months
Solved! Go to Solution.
Hi @sfong002,
In your scenario, you can create a calculated column using the following formula, then use the column in slicer. For more details, you can check the screenshots below.
Date Periods = VAR Datediff = 1 * ( Table1[Date] - TODAY () ) RETURN SWITCH ( TRUE, AND ( Datediff <= 0,Datediff >= -180 ), "Last 6 Months", Datediff < 180, "Older than 6 Months" )
Thanks,
Lydia Zhang
Hi @sfong002,
In your scenario, you can create a calculated column using the following formula, then use the column in slicer. For more details, you can check the screenshots below.
Date Periods = VAR Datediff = 1 * ( Table1[Date] - TODAY () ) RETURN SWITCH ( TRUE, AND ( Datediff <= 0,Datediff >= -180 ), "Last 6 Months", Datediff < 180, "Older than 6 Months" )
Thanks,
Lydia Zhang
If you only need the last 6 months' data anywhere in your report, you can filter the data when you get it, via
If you need that filter applied to just one visual in your report, you may need some more dynamic filtering such as that described by Chris Webb at Building Relative Date Reports in PowerPivot
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |