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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Brighton10
Helper II
Helper II

Add current month dynamically in a table visual

Greetings

I have a table visual in powerBI and would like to show the current month as the first column and also showing only 4 months worth of data. For example in the pbix file attached current month is March 2021 and 4 months back is November 2020, I want next month to dynamically add April 2021 (which will be the current month then) and display until december 2020, May 2021 until January 2021 and so on. I have created the following measures to do the calculation so far but dont know how to make this dynamic.

March 2021 = CALCULATE(SELECTEDVALUE('Dehydrator Runtime'[Dehydrator Runtime (hours)]), FILTER('Dehydrator Runtime','Dehydrator Runtime'[MonthYear]="March 2021"))
===============================================================================
March 2021_ Warning = CALCULATE(SELECTEDVALUE('Dehydrator Runtime'[Warning Duration Hours]), 'Dehydrator Runtime'[MonthYear]="March 2021")
===============================================================================dehydrator_pic.PNGhttps://drive.google.com/drive/folders/147KCbI84SXzhhvSPSeFPM26HfSYtAr9S?usp=sharing 
 
Thank you in advance

 

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Brighton10 ,

 

Accoding to your description, It's suggested to use Matrix visualization.

Measure =
IF (
    CONVERT ( MAX ( 'Dehydrator Runtime'[MonthYear] ) & " 1", DATETIME )
        > EOMONTH ( TODAY (), -4 ),
    SUM ( 'Dehydrator Runtime'[Dehydrator Runtime (hours)] )
)

 3.22.1.Previous.PNG

Please take a look at the pbix file below.

 

Best Regards,
Eyelyn Qin
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

1 REPLY 1
v-eqin-msft
Community Support
Community Support

Hi @Brighton10 ,

 

Accoding to your description, It's suggested to use Matrix visualization.

Measure =
IF (
    CONVERT ( MAX ( 'Dehydrator Runtime'[MonthYear] ) & " 1", DATETIME )
        > EOMONTH ( TODAY (), -4 ),
    SUM ( 'Dehydrator Runtime'[Dehydrator Runtime (hours)] )
)

 3.22.1.Previous.PNG

Please take a look at the pbix file below.

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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