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
oren
Helper III
Helper III

Differences between 2 Matrix in Power BI

Hi

i have 2 metrix that came from the same source 

each metrix have diffrent data that change based on 2 diffrent filters i did (date filters)

now i wand to create anothe metrix that show the difrences between the two tables

 

thanks a lot

 

oren 

7 REPLIES 7
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Oren,

 

Can you share a sample and the expected result, please?

 

Best Regards,

Dale

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

hi again

 

attached is an example
what i need is a third Matrix with the diff between the 2 i have- as you can see the 2 matrix are change based on filter (each matrix have different filter)

 

thanks a lot

 

oren דוגג.PNG

 

Hi @oren,

 

You can try a single measure with "SAMEPERIODLASTYEAR" like below.

Measure =
VAR thisyear =
    SUM ( FactSales[SalesQuantity] )
VAR lastyear =
    CALCULATE (
        SUM ( FactSales[SalesQuantity] ),
        SAMEPERIODLASTYEAR ( DimDate[Datekey] )
    )
RETURN
    thisyear - lastyear

Best Regards,

Dale

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

Dhanks Dale

 

as you seggested i put this dax -

 

DiffDiscount =
VAR thisyear =
SUM ( 'DATA'[Discount] )
VAR lastyear =
CALCULATE (
SUM ( 'DATA'[Discount] ),
SAMEPERIODLASTYEAR ( 'Dateuniqe'[PriceLogDate] )
)
RETURN
thisyear - lastyear

 

but i just get the same data as in the "current Discount"

(maybe i dont know waht to use in the "SAMEPERIODLASTYEAR ( 'Dateuniqe'[PriceLogDate] )" - i just took a uniq dates table (is it right?)

 

attached is the data i got (the right table)

 

thanks again

 

oren 

דוגג.PNG

no option?

anything ?

Anonymous
Not applicable

Hi @oren

 

You will not be able to compare 2 matrix as such. You need to have measures to do this.

 

For ex: you may have sum ( sales) in Matrix1. Matrix 2 with different date filter say fo ex 05/18/2018 in Matrix1 and 05/19/2018 in Matrix 2.

 

In your New matrix, you may need to like this:

 

Sales_diff = CALCULATE ( SUM(Sales), date="05/18/2018" )-CALCULATE ( SUM(Sales), date="05/19/2018" )

 

Hope this gives you the direction.

 

Thanks

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.

Top Solution Authors