Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi all,
I am trying to create a column labeled '12 Months', '18 Months' and '24 Months' according to which values in this table have a 1 or 0 in the columns labeled the same way:
The column would be used as a slicer in the report for a user to select a time period. I have tried using IF, SWITCH and other methods but cannot figure out how to do this.
Solved! Go to Solution.
Hello, couple of ways to do it. This is probably going to be the easiest:
1. Make a unconnected Table with the names of the Time period you want
2. Reference the time period names from the new table in a calculation like this:
Value =
IF(HASONEFILTER(Table[CalcType]),
SWITCH(SELECTEDVALUE(Table[CalcType]),
"12Months", [12MonthCalc],
"18Months", [18MonthCalc],
"24Months", [24MonthCalc]
),
BLANK()
)Any new ones need to be referenced in this calculation but its not a lot of work to do.
Hello, couple of ways to do it. This is probably going to be the easiest:
1. Make a unconnected Table with the names of the Time period you want
2. Reference the time period names from the new table in a calculation like this:
Value =
IF(HASONEFILTER(Table[CalcType]),
SWITCH(SELECTEDVALUE(Table[CalcType]),
"12Months", [12MonthCalc],
"18Months", [18MonthCalc],
"24Months", [24MonthCalc]
),
BLANK()
)Any new ones need to be referenced in this calculation but its not a lot of work to do.
Hello there, I need exactly this, but I'm not able to understand the solution properly... 😕
Could you please explain it to me in a bit more detail?
The "Value" - it's measure?
And what is "Table" and the column [CalcType]? Is it the new disconnected table?
And which field do I use in the slicer?
Your help would be very much appreciated!
Thank you.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 22 | |
| 22 | |
| 18 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 52 | |
| 47 | |
| 40 | |
| 38 |