To complete this recipe, do the following:
- Create the following columns in the R10_Table table:
IsCurrentQuarter =
VAR __Today = TODAY()
VAR __CurrentYear = YEAR(__Today)
VAR __CurrentQuarter = QUARTER(__Today)
VAR __Year = YEAR('R10_Table'[Value])
VAR __Quarter = QUARTER('R10_Table'[Value])
RETURN
IF(
__Year = __CurrentYear &&
__Quarter = __CurrentQuarter,
TRUE,
FALSE
)
DTS =
IF(
'R10_Table'[IsCurrentQuarter],
"W" & WEEKNUM('R10_Table'[Value]) & " - " & YEAR('R10_Table'[Value]),
"Q" & QUARTER('R10_Table'[Value]) & " - " & YEAR('R10_Table'[Value])
)
DTS Sort By =
IF(
'R10_Table'[IsCurrentQuarter],
YEAR('R10_Table'[Value]) & QUARTER('R10_Table'[Value]) & WEEKNUM('R10_Table'[Value]),
YEAR('R10_Table'[Value]) & QUARTER('R10_Table'[Value])
)
- Set the Sort by column for the DTS column in the R10_Table table to the DTS Sort By column in the R10_Table table.
- On a Report page, create a Clustered column chart visualization and place the DTS column from the R10_Table table into the Axis area.
- For the same Clustered column chart, place the IsCurrentQuarter column from the R10_Table table into the Legend area.
- For the same Clustered column chart, place the Inventory column from the R10_Table table into the Values area and change the aggregation to Average.