Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi All,
I have a requirement to show on X-Axis Last Period of last Year plus all periods of current year … i.e.,Screenshot here
YearPeriod Desired Output
I already have a Column year period in format ex: "2021 P01" that is coming from the SQL server table.
I have a single selector slicer on Fiscal Year i.e., 2020,2021,2022, etc.,
so based on Year selected, I should show this X-Axis dynamically to display only the last period of the previous year and all periods of the current year.
EDIT :
So Far I am able to get the last period last year value dynamically based on year slicer selection however I am unable to pass this as a filter to show as desired.
CustomYearPeriod = VAR MonthN = If(dim_date[CalendarMonth] < 10, "0" & dim_date[CalendarMonth],dim_date[CalendarMonth])
VAR TargetYear = VALUE(dim_date[FiscalYear])
VAR PreviousYr = TargetYear-1
Var MaxPeriod = Max(dim_date[CalendarMonth])
VAR Result = CALCULATE(Min(dim_date[CalendarYearPeriod]),FILTER(dim_date,dim_date[CalendarYearPeriod] >=
PreviousYr &" P" & MaxPeriod))
Return Result
Thanks,
Archer
Create a new column in your calendar table and fill it in with 2 values. One value will mean "the last period last year or all periods of this year up to and including current", the other will mean the contrary. Then use this column to filter your visual/page/report via the Filter Pane.
Alternatively, use Calculation Groups to change all measures in one go so that they display BLANK when the item on the x-axis is not what you want.
User | Count |
---|---|
20 | |
19 | |
15 | |
10 | |
7 |
User | Count |
---|---|
28 | |
28 | |
13 | |
12 | |
12 |