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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate difference between two rows of a measure

Hello brilliant community,

 

I need help with dax to calculate difference between two rows of a measure. Following is a snapshot of my report:

 

Capture.PNG

 

I need a measure for following:

Additional clients/month = active clients accumalative in current month - active clients accumalative in previous month

 

Attached is my PBI: https://1drv.ms/u/s!Ag919_pO_UKrfqo40LZG9az7zU4?e=qA8erh

 

Many thanks in advance,

Meena

 

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

Hi, @Anonymous 

Based on your description,

 

You can create measure Additional clients/month’ as follows.

 

Active Clients accumulative in current month =

VAR runtott =

    CALCULATE (

        COUNT ( Active_Clients[PTNT_ID] ),

        FILTER (

            ALL ( Active_Clients ),

            Active_Clients[CREATED] <= MAX ( Datedim[Date] )

        )

    )

RETURN

    IF ( MAX ( Datedim[Date] ) <= TODAY () + 30, runtott, BLANK () )

 

Additional clients/month = COUNT ( Active_Clients[PTNT_ID] )+0

 

Result:

 

xxx.png

 

Best Regards,

Allan

 

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-alq-msft
Community Support
Community Support

Hi, @Anonymous 

Based on your description,

 

You can create measure Additional clients/month’ as follows.

 

Active Clients accumulative in current month =

VAR runtott =

    CALCULATE (

        COUNT ( Active_Clients[PTNT_ID] ),

        FILTER (

            ALL ( Active_Clients ),

            Active_Clients[CREATED] <= MAX ( Datedim[Date] )

        )

    )

RETURN

    IF ( MAX ( Datedim[Date] ) <= TODAY () + 30, runtott, BLANK () )

 

Additional clients/month = COUNT ( Active_Clients[PTNT_ID] )+0

 

Result:

 

xxx.png

 

Best Regards,

Allan

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.