Forum Discussion
Visual Filters Based on Field Parameter
- Anonymous1 year ago
Hi Anonymous ,
You can try the following steps.
1. create two year columns, one for calendar year and one for fiscal year.CY = YEAR('DAX DateTable'[Date])FY = IF ( 'DAX DateTable'[Date] >= DATE ( YEAR ( 'DAX DateTable'[Date] ), 1, 1 ) && 'DAX DateTable'[Date] <= DATE ( YEAR ( 'DAX DateTable'[Date] ), 3, 31 ), YEAR ( 'DAX DateTable'[Date] ) - 1, YEAR ( 'DAX DateTable'[Date] ) )2. Create field parameters for these two columns.
3. Create a year table and do not create relationships with other tables.
4. Create MEASURE.
MEASURE = IF ( MAX ( 'Parameter'[Parameter] ) = "FY" && MAX ( 'Table'[year] ) = MAX ( 'DAX DateTable'[FY] ), MAX ( 'DAX DateTable'[FY] ), IF ( MAX ( 'Parameter'[Parameter] ) = "CY" && MAX ( 'Table'[year] ) = MAX ( 'DAX DateTable'[CY] ), MAX ( 'DAX DateTable'[CY] ) ) )The final result is shown below.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
You can try the following steps.
1. create two year columns, one for calendar year and one for fiscal year.
CY =
YEAR('DAX DateTable'[Date])
FY =
IF (
'DAX DateTable'[Date] >= DATE ( YEAR ( 'DAX DateTable'[Date] ), 1, 1 )
&& 'DAX DateTable'[Date] <= DATE ( YEAR ( 'DAX DateTable'[Date] ), 3, 31 ),
YEAR ( 'DAX DateTable'[Date] ) - 1,
YEAR ( 'DAX DateTable'[Date] )
)
2. Create field parameters for these two columns.
3. Create a year table and do not create relationships with other tables.
4. Create MEASURE.
MEASURE =
IF (
MAX ( 'Parameter'[Parameter] ) = "FY"
&& MAX ( 'Table'[year] ) = MAX ( 'DAX DateTable'[FY] ),
MAX ( 'DAX DateTable'[FY] ),
IF (
MAX ( 'Parameter'[Parameter] ) = "CY"
&& MAX ( 'Table'[year] ) = MAX ( 'DAX DateTable'[CY] ),
MAX ( 'DAX DateTable'[CY] )
)
)
The final result is shown below.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.