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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Build a string from a filter selection

Hi,

 

I am trying to build a string every time I make a selectiong from a filter I added from a table I added see the table below

 

The month the month that is selected in the filter must return the previous month string

e.g If the selected value is May the string must return APRFCST
If the selected value is Jun the string must return MAYFCST

If the selected value is Jul the string must return JULFCST

 

Month NumMonth Short
Apr1
May2
Jun3
Jul4
Aug5
Sep6
Oct4
Nov8
Dec9

 

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

Create slicer table as:

Slicer = 
VALUES('Table'[Month Num])

Create column as:

Column = 
CALCULATE(
    MAX('Table'[Month Num]),
    FILTER(
        'Table',
        'Table'[Month Short]=EARLIER('Table'[Month Short])-1
        )
    )

Create measure as:

Measure = 
var _month=
CALCULATE(
    MAX('Table'[Column]),
    FILTER(
        'Table',
        'Table'[Month Num]=ALLSELECTED(Slicer[Month Num])
    )
)
return
CONCATENATE(_month,"FCST")

Here is the output:

vxulinmstf_0-1630919753061.png

The demo is attached, please try it.

 

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

View solution in original post

2 REPLIES 2
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

Create slicer table as:

Slicer = 
VALUES('Table'[Month Num])

Create column as:

Column = 
CALCULATE(
    MAX('Table'[Month Num]),
    FILTER(
        'Table',
        'Table'[Month Short]=EARLIER('Table'[Month Short])-1
        )
    )

Create measure as:

Measure = 
var _month=
CALCULATE(
    MAX('Table'[Column]),
    FILTER(
        'Table',
        'Table'[Month Num]=ALLSELECTED(Slicer[Month Num])
    )
)
return
CONCATENATE(_month,"FCST")

Here is the output:

vxulinmstf_0-1630919753061.png

The demo is attached, please try it.

 

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

Anonymous
Not applicable

The below is what I am trying to achieve:

Forecast =
 
VAR FCST = ???? ****I need to build the string here****
 

RETURN
 
CALCULATE( Sum('ABF'[Amount]),
ALL('Forecast List'),
'ABF'[Category]=FCST )
 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.