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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Create a Variable for Text Box's

Every month we run a report every month.  We navigate through 7 or 8 sheets and manually change the text box's to have the updated month(Jan, Feb, Etc.).  

Is there a way to create an object in the text box's so we only have to change one text box and it automatically updates all the other pages?

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

In Excel,

Sheet1:

2022.1.1 – 2022.2.28

Sheet2:

2022.1.1 – 2022.2.23

Sheet3:

2022.1.1 – 2022.2.16

Here are the steps you can follow:

1. Create measure.

Flag1 =
IF(
YEAR( MAX('Sheet1'[Date]))=YEAR(MAXX(ALL('Sheet1'[Date]),[Date]))&&MONTH(MAX('Sheet1'[Date]))=MONTH(MAXX(ALL('Sheet1'[Date]),[Date])),1,0
)
Flag2 =
IF(
YEAR( MAX('Sheet2'[Date]))=YEAR(MAXX(ALL('Sheet2'[Date]),[Date]))&&MONTH(MAX('Sheet2'[Date]))=MONTH(MAXX(ALL('Sheet2'[Date]),[Date])),1,0
)
Flag3 =
IF(
YEAR( MAX('Sheet3'[Date]))=YEAR(MAXX(ALL('Sheet3'[Date]),[Date]))&&MONTH(MAX('Sheet3'[Date]))=MONTH(MAXX(ALL('Sheet3'[Date]),[Date])),1,0
)

2. Put [Flag1] , [Flag2] , [Flag3] in the corresponding Visual - Filter in Page1, Page2, Page3.

vyangliumsft_0-1647498347005.png

3. When you update to a new date in Excel, you can directly click Refresh, and then Page1, Page2, and Page3 will display the data of the current month on the latest date

vyangliumsft_1-1647498347006.png

4. Result:

Update the date to March in Excel, after refreshing, the data for March is displayed in Page1.

vyangliumsft_2-1647498347006.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

In Excel,

Sheet1:

2022.1.1 – 2022.2.28

Sheet2:

2022.1.1 – 2022.2.23

Sheet3:

2022.1.1 – 2022.2.16

Here are the steps you can follow:

1. Create measure.

Flag1 =
IF(
YEAR( MAX('Sheet1'[Date]))=YEAR(MAXX(ALL('Sheet1'[Date]),[Date]))&&MONTH(MAX('Sheet1'[Date]))=MONTH(MAXX(ALL('Sheet1'[Date]),[Date])),1,0
)
Flag2 =
IF(
YEAR( MAX('Sheet2'[Date]))=YEAR(MAXX(ALL('Sheet2'[Date]),[Date]))&&MONTH(MAX('Sheet2'[Date]))=MONTH(MAXX(ALL('Sheet2'[Date]),[Date])),1,0
)
Flag3 =
IF(
YEAR( MAX('Sheet3'[Date]))=YEAR(MAXX(ALL('Sheet3'[Date]),[Date]))&&MONTH(MAX('Sheet3'[Date]))=MONTH(MAXX(ALL('Sheet3'[Date]),[Date])),1,0
)

2. Put [Flag1] , [Flag2] , [Flag3] in the corresponding Visual - Filter in Page1, Page2, Page3.

vyangliumsft_0-1647498347005.png

3. When you update to a new date in Excel, you can directly click Refresh, and then Page1, Page2, and Page3 will display the data of the current month on the latest date

vyangliumsft_1-1647498347006.png

4. Result:

Update the date to March in Excel, after refreshing, the data for March is displayed in Page1.

vyangliumsft_2-1647498347006.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

truptis
Community Champion
Community Champion

Hi @Anonymous ,
If you want to show the latest month when the refresh occured, you can create a measure - 

M1 = var latest_date = MAX(date)
return MONTH(latest_date)

So, if you have refreshed the report today(14th March 2022), latest_date will be 14th March 2022 and M1 will return MARCH. 

You can have a card visual and put this measure in it. You can copy paste the same card on all the pages where you want to show the month. 

By this way, everytime the report gets refreshed, the text on the card would change dynamically. 

@Anonymous if this helps you, then please mark it as a solution and hit the thumbs up. Thank you.

Regards,

TruptiS
 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.