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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Global variables in Power BI

Hi All,

 

I have a report which contains 'Date' slicer.

I want to create 2 variables which will store the Date values for last month and month before last values based on slicer selection.

For example, if user selects 1 March 2017, then the 2 variables should have values as 1 February 2017 and 1 January 2017 respectively. 

Once I have these 2 date values I need to update the header text of table columns.

 

Please let me know of how I can achieve this.

 

Thanks in advance.

 

Regards,

Vinayak

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

Not aware of a way that you can do that as described.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank you for your comment @Greg_Deckler

I am evaluating custom visual approach to achieve this functionality.

Anonymous
Not applicable

Hi Vinayak,

 

I am also looking for same scenario and global variable to acheive this.

 

could you please suggest how you resole this case.

 

Regards,

Deeksha

Anonymous
Not applicable

Hi Deeksha,

 

I was unable to achieve it using global variables at that time.

 

However I had developed a custom visual similar to the 'table' visual available by default in Power BI.

It would dynamically change its column header values as per the date value selected in date slicer.

Hope this helps.

 

Regards,

Vinayak

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.

Top Solution Authors