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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PrivateAnalytic
Helper IV
Helper IV

Creating a Current Month Column in a Report

Hello all!

 

I am looking to create a Month over Month column in my Report. I am looking it to be where the most recent month available is 1, and month before that is 2, and the month before that one is 3, and so on and so forth.

1 ACCEPTED SOLUTION

Hi @PrivateAnalytic ,

 

Maybe you can try this expression:

Column =
VAR _DIFF =
    DATEDIFF (
        DATE ( 2000 + VALUE ( RIGHT ( [READY_DATE], 2 ) ), VALUE ( LEFT ( [READY_DATE], 2 ) ), 1 ),
        TODAY (),
        MONTH
    )
RETURN
    IF ( _DIFF > 12, 0, _DIFF )

 

Result:

vchenwuzmsft_0-1656677997415.png

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

4 REPLIES 4
croberts21
Continued Contributor
Continued Contributor

Can you give us an example table to show us what it would look like? In your reply here, if you click the "Code" button first, then insert your table there, I think the output will be preformatted fixed width text which would be easier to read. 

Hello! @croberts21  

 

So I manually input a column to help specify the month and year of a record in the table. Example: "0522" occurred in May of 2022. However, "0100" does not have a date to it. I was looking to create a dynamic column to help signifiy the most recent month we have in the table. So "0522" would ideally be 1 or -1, and the month before that be -2 or 2. And so on and so fourth

PrivateAnalytic_0-1656507606776.png

 

Hi @PrivateAnalytic ,

 

Maybe you can try this expression:

Column =
VAR _DIFF =
    DATEDIFF (
        DATE ( 2000 + VALUE ( RIGHT ( [READY_DATE], 2 ) ), VALUE ( LEFT ( [READY_DATE], 2 ) ), 1 ),
        TODAY (),
        MONTH
    )
RETURN
    IF ( _DIFF > 12, 0, _DIFF )

 

Result:

vchenwuzmsft_0-1656677997415.png

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

This was exactly what I was looking for! Thank you for the advice!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.