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
TobiasWiegand
Regular Visitor

Compare different statuses measure

Hello, 
I have a table which represents different values for different time frames on different status days (current status). E.g. value from status 23.05. for YYYYMM 202402 is 236520 and value from status 23.06. for YYYYMM 202402 is 149040.

 

I want to create a measure that shows the difference from current status 23.06 to the previous status (23.05.) - here 236520-149040= 87480 like I can do in a pivot in xls as "show difference from previous current status". To choose which current statuses to compare from, I would set two filters which 1. base filter 2. compare filter two select the two statuses for comparison. How can I do this?

 

Thank you!

 

TobiasWiegand_1-1700485746683.png

 

 

1 ACCEPTED SOLUTION

hi @TobiasWiegand ,

 

not sure if i fully get you, supposing you have a data table like:

FreemanZ_0-1700533455542.png

 

try to

1) plot two slicers with two calculated tables like:

Slicer1 = ALL(data[Status])
Slicer2 = ALL(data[Status])

 

2) plot a card visual with a measure like:

Diff = 
MAXX(
    FILTER(data,data[Status]=SELECTEDVALUE(Slicer2[Status])),
    data[Qty]
) -
MAXX(
    FILTER(data,data[Status]=SELECTEDVALUE(Slicer1[Status])),
    data[Qty]
) 

 

it worked like:

FreemanZ_1-1700533550225.pngFreemanZ_2-1700533569947.png

 

 

View solution in original post

3 REPLIES 3
Dangar332
Super User
Super User

Hi, @TobiasWiegand 

 

try below code 

Measure 2 = 
var a = MAXX(
           FILTER(
              ALL('Table (2)'),
              'Table (2)'[current status]<MAX('Table (2)'[current status])
           ),
           'Table (2)'[qty]
        )
return
SUM('Table (2)'[qty])-a

Hi Dangar, 

 

thanks for your reply. The above solution doesn't work because the field "current status" is a text field and needs to stay one. Therefore PBI cannot compare which one is smaller. 

 

I would simply Like to Have 2 filters:

 

Filter 1 (Base Status): 23.05.
Filter 2 (Compare Compare): 23.06.

leading to a table showing

23.05.         23.06.
236520      -87480

hi @TobiasWiegand ,

 

not sure if i fully get you, supposing you have a data table like:

FreemanZ_0-1700533455542.png

 

try to

1) plot two slicers with two calculated tables like:

Slicer1 = ALL(data[Status])
Slicer2 = ALL(data[Status])

 

2) plot a card visual with a measure like:

Diff = 
MAXX(
    FILTER(data,data[Status]=SELECTEDVALUE(Slicer2[Status])),
    data[Qty]
) -
MAXX(
    FILTER(data,data[Status]=SELECTEDVALUE(Slicer1[Status])),
    data[Qty]
) 

 

it worked like:

FreemanZ_1-1700533550225.pngFreemanZ_2-1700533569947.png

 

 

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!

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.