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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mkane12
Frequent Visitor

Time Calculations in Calculation Groups - add month name

is it possible to add the month date to the calculation group instead of it just saying current month, prev month, prev month+1 , prev month+2, etc?

 

mkane12_0-1744736381697.png

 

1 ACCEPTED SOLUTION
v-dineshya
Community Support
Community Support

Hi @mkane12 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please follow below steps.

 

1. Created "Date"  and "Sales"  tables  based on your screenshot with sample data. Please refer snap.

vdineshya_0-1752134539786.pngvdineshya_1-1752134579354.png

 

 

2. Created Disconnected Table "MonthOffsetTable"  for Month Offsets, with below DAX code.

 
MonthOffsetTable =
DATATABLE (
    "OffsetLabel", STRING,
    "OffsetValue", INTEGER,
    {
        { "Current Month", 0 },
        { "Previous Month", -1 },
        { "Previous Month +1", -2 },
        { "Previous Month +2", -3 }
    }
)
 
3.  Created Measure "Dynamic Revenue" with below DAX code.
 
Dynamic Revenue =
VAR Offset = SELECTEDVALUE(MonthOffsetTable[OffsetValue])
RETURN
CALCULATE(
    SUM(Sales[Revenue]),
    DATEADD('Date'[Date], Offset, MONTH)
)
 
4. I have dragged the  'MonthOffsetTable'[OffsetLabel]  in Column field and "Dynamic Revenue" measure in value field in Matrix visual. Please refer output snap and attached PBIX file.
 
vdineshya_2-1752134912862.png

 

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

View solution in original post

9 REPLIES 9
v-dineshya
Community Support
Community Support

Hi @mkane12 ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please follow below steps.

 

1. Created "Date"  and "Sales"  tables  based on your screenshot with sample data. Please refer snap.

vdineshya_0-1752134539786.pngvdineshya_1-1752134579354.png

 

 

2. Created Disconnected Table "MonthOffsetTable"  for Month Offsets, with below DAX code.

 
MonthOffsetTable =
DATATABLE (
    "OffsetLabel", STRING,
    "OffsetValue", INTEGER,
    {
        { "Current Month", 0 },
        { "Previous Month", -1 },
        { "Previous Month +1", -2 },
        { "Previous Month +2", -3 }
    }
)
 
3.  Created Measure "Dynamic Revenue" with below DAX code.
 
Dynamic Revenue =
VAR Offset = SELECTEDVALUE(MonthOffsetTable[OffsetValue])
RETURN
CALCULATE(
    SUM(Sales[Revenue]),
    DATEADD('Date'[Date], Offset, MONTH)
)
 
4. I have dragged the  'MonthOffsetTable'[OffsetLabel]  in Column field and "Dynamic Revenue" measure in value field in Matrix visual. Please refer output snap and attached PBIX file.
 
vdineshya_2-1752134912862.png

 

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

Hi @mkane12 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

v-dineshya
Community Support
Community Support

Hi @mkane12 ,

Thank you for reaching out to the Microsoft Community Forum.

 

You'll need to update the Calculation Group name column to use a dynamic format based on the current date context.

Can you please follow this steps:

Open Tabular Editor (either in Power BI Desktop or as a standalone). Go to your Calculation Group (e.g., "Time Intelligence"). Locate the Name or DisplayName expression (the one that controls what’s shown in the visual). Replace it with a DAX expression that calculates the actual month name.

DAX measure for Calculation Group name:

VAR CurrentDate = SELECTEDMEASURE()
VAR MonthOffset = SELECTEDVALUE('Time Intelligence'[Offset])
VAR TargetDate = EOMONTH(TODAY(), MonthOffset)
RETURN FORMAT(TargetDate, "MMM YYYY")

Note: This assumes you have an Offset column in your Calculation Group with values like 0 for current month, -1 for previous month, 1 for next month, etc.

If you still want to include labels like “Current Month” alongside the date:

DAX :

VAR Offset = SELECTEDVALUE('Time Intelligence'[Offset])
VAR Label =
SWITCH(Offset,
0, "Current Month",
-1, "Previous Month",
1, "Next Month",
-2, "Previous Month -1",
2, "Next Month +1",
BLANK()
)
VAR TargetDate = EOMONTH(TODAY(), Offset)
RETURN Label & " (" & FORMAT(TargetDate, "MMM YYYY") & ")"

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

Thank you

thanks, but I am a little confused. Where exactly am i putting this? For example, this is my current month calc. Can you point me in the right direction or show me an example? Sorry, i'm a newbie at power bi.  

mkane12_0-1744818170481.png

 

uzuntasgokberk
Super User
Super User

Hello @mkane12 ,

 

I hope that I understand correctly. İnstead of Current Month, Previous Month etc. you'd like to see Today month for example April. So that, you'd like to see April, March, February and January. İf it so,

You can use workaround solution with textbox or with card. I'm showing text solution which is easy way.

First create a measure for example CurrentMonth:

uzuntasgokberk_0-1744748978414.png

Second, create a text box in the insert tab. And then click text box you'll se a box. Within the box click Value button and write your measure name and save. 

uzuntasgokberk_1-1744748997975.png

 

Lastly, you can insert a shape if you'd like to visualize more suitable way and in format tab click bring to front. That means you have 2 visualization in the same are so that the text box needs to be shown.

 

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

Hi @mkane12 ,

If @uzuntasgokberk  response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found his response helpful.

Thank you

HI @mkane12 ,

If @uzuntasgokberk  response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found his response helpful.

Thank you

HI @mkane12 ,

If @uzuntasgokberk  response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found his response helpful.

Thank you

HI @mkane12 ,

If @uzuntasgokberk  response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found his response helpful.

Thank you

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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