Forum Discussion
oren
Helper III
8 years agoDifferences 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 difr...
v-jiascu-msft
Microsoft Employee
8 years agoHi 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
oren
Helper III
8 years agoDhanks 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
- oren8 years ago
Helper III
no option?