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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How to show diffrence between 2 weeks in one table?

Hi

Could someone help me how to show diffrences between weeks?

This is an example.

Sales team has deals with stages, in diffrent weeks and values.

I need to show "THE Diffrence" between two weeks (checked in visualisations)

The result I am looking for in the last table

 

Can somebody help?

Thanks in advance

 

exer.png

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

Hi @Anonymous ,

 

Please create a new table.

 

Table 2 = 
VAR tab =
    CROSSJOIN (
        ALLSELECTED ( 'Table'[Salesman] ),
        ALLSELECTED ( 'Table'[Stage] ),
        ALLSELECTED ( 'Table'[Week] )
    )
RETURN
    ADDCOLUMNS ( tab, "Value", CALCULATE ( SUM ( 'Table'[Value] ) ) )

 

Then use the measure.

 

Measure = 
SUM ( 'Table 2'[Value] )
    - CALCULATE (
        SUM ( 'Table 2'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table 2'[Week] ),
            'Table 2'[Week]
                = MAX ( 'Table 2'[Week] ) - 1
        )
    )

vkkfmsft_0-1654755086620.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please create a new table.

 

Table 2 = 
VAR tab =
    CROSSJOIN (
        ALLSELECTED ( 'Table'[Salesman] ),
        ALLSELECTED ( 'Table'[Stage] ),
        ALLSELECTED ( 'Table'[Week] )
    )
RETURN
    ADDCOLUMNS ( tab, "Value", CALCULATE ( SUM ( 'Table'[Value] ) ) )

 

Then use the measure.

 

Measure = 
SUM ( 'Table 2'[Value] )
    - CALCULATE (
        SUM ( 'Table 2'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table 2'[Week] ),
            'Table 2'[Week]
                = MAX ( 'Table 2'[Week] ) - 1
        )
    )

vkkfmsft_0-1654755086620.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

//Date1 is independent Date table
new measure =
var _max = maxx(allselected(Date),Date[Week])
var _min = minx(allselected(Date),Date[Week])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Date] =_max)) - calculate( sum(Table[Value]), filter('Table', 'Table'[Date] =_min))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors