Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
LupinAinsworth
Frequent Visitor

Help with deduping code

Hi! Can someone help me please dedupe this DAX? It is resulting in the sample below. I would like to only see one portion of this text, I do not want it repeated. Please help!

"Received a second merit adjustment to $/hr effective September 2022: Base Year 0: 5.00% Plan Year 1: 5.00% Plan Year 2: 5.00% Plan Year 3: 5.00% Plan Year 4: 5.00% Plan Year 5: 0.00%

 

Received a second merit adjustment to $/hr effective September 2022: Base Year 0: 5.00% Plan Year 1: 5.00% Plan Year 2: 5.00% Plan Year 3: 5.00% Plan Year 4: 5.00% Plan Year 5: 0.00% $31,862 6,000,120.00 %"

 

IF (
HASONEVALUE ( 'PayBUDMngrInput'[EMPLOYEE] ),
VAR vrRawTable =
FILTER (
'PayBUDMngrInput',
'PayBUDMngrInput'[RecordType]
IN { "Adjustments to merit", "Adjustments to merit2" }
&& 'PayBUDMngrInput'[IsApproved] = TRUE ()
)
VAR vrTable =
ADDCOLUMNS (
SUMMARIZE (
vrRawTable,
'PayBUDMngrInput'[RecordType],
'PayBUDMngrInput'[AdjustAmount],
'PayBUDMngrInput'[YRMO],
'PayBUDMngrInput'[MeritAdjustBaseYr],
'PayBUDMngrInput'[MeritAdjustPlanYr1],
'PayBUDMngrInput'[MeritAdjustPlanYr2],
'PayBUDMngrInput'[MeritAdjustPlanYr3],
'PayBUDMngrInput'[MeritAdjustPlanYr4],
'PayBUDMngrInput'[MeritAdjustPlanYr5]
),
"DisplayRecord",
IF (
SELECTEDVALUE ( 'PayBUDMngrInput'[RecordType] ) = "Adjustments to merit",
"Received a merit adjustment",
"Received a second merit adjustment"
)
)
RETURN
IF (
COUNTROWS ( vrTable ) > 0,
CONCATENATEX (
vrTable,
[DisplayRecord] & " to "
& FORMAT ( [AdjustAmount], "$###,###/hr" ) & " effective " & [YRMO] & ": "
& UNICHAR ( 10 ) & "Base Year 0: "
& FORMAT ( [MeritAdjustBaseYr], "##0.00%" )
& UNICHAR ( 10 ) & "Plan Year 1: "
& FORMAT ( [MeritAdjustPlanYr1], "##0.00%" )
& UNICHAR ( 10 ) & "Plan Year 2: "
& FORMAT ( [MeritAdjustPlanYr2], "##0.00%" )
& UNICHAR ( 10 ) & "Plan Year 3: "
& FORMAT ( [MeritAdjustPlanYr3], "##0.00%" )
& UNICHAR ( 10 ) & "Plan Year 4: "
& FORMAT ( [MeritAdjustPlanYr4], "##0.00%" )
& UNICHAR ( 10 ) & "Plan Year 5: "
& FORMAT ( [MeritAdjustPlanYr5], "##0.00%" )
& UNICHAR ( 10 )
& UNICHAR ( 10 ),
UNICHAR ( 10 ),
[RecordType], DESC
)
),
IF (
HASONEVALUE ( 'EMPLOYEE'[EMPLOYEE name] ),
"--No Manager Inputs for Employee --",
"--Click on a single Employee--"
)
)

1 ACCEPTED SOLUTION
FBergamaschi
Solution Sage
Solution Sage

Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.

 

Need help uploading data? click here

 

Want faster answers? click here

View solution in original post

4 REPLIES 4
v-tejrama
Community Support
Community Support

Hi @LupinAinsworth ,

 

Thank you @FBergamaschi , for your response. With a small sample dataset (in text or table format), the model view, and the expected outcome, we will be able to successfully reproduce the issue in Power BI and deliver an effective solution.

Thank you.

 

Hi @LupinAinsworth ,

 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

Thank you,

Tejaswi.

 

Hi @LupinAinsworth ,

 

Just checking in have you been able to resolve this issue? If so, it would be greatly appreciated if you could mark the most helpful reply accordingly. This helps other community members quickly find relevant solutions.

 

Thank you,

Tejaswi.

FBergamaschi
Solution Sage
Solution Sage

Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.

 

Need help uploading data? click here

 

Want faster answers? click here

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.