Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Folks,
I have Period ,FeeType, FeeDescri columns in my model. i want to add new column based on Period and Feetype.
Ex: 2022Q1 and QF then i want to add First Quarter 2002 + FeeDescri
Ex2: 202209 and MF then i want to add September 2022+ FeeDescri
Can we achive this with DAX. Please help me
Thanks in Advance.
Solved! Go to Solution.
Hi @Gopal_PV
Please refer to attached sample file with the proposed solution
Result =
VAR CurrentDescription = 'Table'[FeeDescri]
VAR CurrentPeriod = 'Table'[Period]
VAR CurrentYear = LEFT ( CurrentPeriod, 4 )
VAR MonthOrQuarter1 = SUBSTITUTE ( CurrentPeriod, CurrentYear, "" )
VAR MonthOrQuarter2 =
IF (
ISERROR ( VALUE ( CurrentPeriod) ),
SWITCH (
RIGHT ( MonthOrQuarter1, 1 ),
"1", "First Quarter",
"2", "Second Quarter",
"3", "Third Quarter",
"4", "Fourth Quarter"
),
FORMAT ( DATE ( CurrentYear, MonthOrQuarter1, 1 ), "mmmm" )
)
RETURN
MonthOrQuarter2 & " " & CurrentYear & " " & CurrentDescription
Hi @Gopal_PV
Please refer to attached sample file with the proposed solution
Result =
VAR CurrentDescription = 'Table'[FeeDescri]
VAR CurrentPeriod = 'Table'[Period]
VAR CurrentYear = LEFT ( CurrentPeriod, 4 )
VAR MonthOrQuarter1 = SUBSTITUTE ( CurrentPeriod, CurrentYear, "" )
VAR MonthOrQuarter2 =
IF (
ISERROR ( VALUE ( CurrentPeriod) ),
SWITCH (
RIGHT ( MonthOrQuarter1, 1 ),
"1", "First Quarter",
"2", "Second Quarter",
"3", "Third Quarter",
"4", "Fourth Quarter"
),
FORMAT ( DATE ( CurrentYear, MonthOrQuarter1, 1 ), "mmmm" )
)
RETURN
MonthOrQuarter2 & " " & CurrentYear & " " & CurrentDescription
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |