Forum Discussion
Dynamic Date Slicer | Calculated Columns for Current Quarter and Current Year
- Anonymous5 years ago
Hi Anonymous
I think your requirement is to build two dynamic Year and dynamic Quarter to show current value or actual value by selection. Unfortunately, calculated column couldn't show dynamic results like this. I think you can try measure. Measure supports to show dynamic results by selections.
For reference:
Calculated Columns vs Measures
What is the difference between Power BI calculated columns and measures?
Build a table, then create a slicer by this table.
Measures:
Dynamic Year = VAR _SELECTION = SELECTEDVALUE(Selection[Selection]) RETURN IF(_SELECTION = "Actual",YEAR(MAX(dimCalendar[Date])),YEAR(TODAY()))Dynamic Quarter = VAR _SELECTION = SELECTEDVALUE(Selection[Selection]) RETURN IF(_SELECTION = "Actual",QUARTER(MAX(dimCalendar[Date])),QUARTER(TODAY()))Result is as below.
Select "Actual":
Select "Current":
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
I think your requirement is to build two dynamic Year and dynamic Quarter to show current value or actual value by selection. Unfortunately, calculated column couldn't show dynamic results like this. I think you can try measure. Measure supports to show dynamic results by selections.
For reference:
Calculated Columns vs Measures
What is the difference between Power BI calculated columns and measures?
Build a table, then create a slicer by this table.
Measures:
Dynamic Year =
VAR _SELECTION = SELECTEDVALUE(Selection[Selection])
RETURN
IF(_SELECTION = "Actual",YEAR(MAX(dimCalendar[Date])),YEAR(TODAY()))Dynamic Quarter =
VAR _SELECTION = SELECTEDVALUE(Selection[Selection])
RETURN
IF(_SELECTION = "Actual",QUARTER(MAX(dimCalendar[Date])),QUARTER(TODAY()))
Result is as below.
Select "Actual":
Select "Current":
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.