Forum Discussion
Difference between Multiple Columns in Matrix Presented as Rows
- 4 years ago
Hi milkywaypowerbi ,
Try this:
Profit Diff = VAR CurrentYear_ = MAX ( Sheet1[Year] ) VAR PreviousYear_ = MAXX ( FILTER ( ALL ( Sheet1[Year] ), Sheet1[Year] < CurrentYear_ ), [Year] ) VAR CurrentProfit_ = [Profit] VAR PreviousProfit_ = CALCULATE ( [Profit], FILTER ( ALL ( Sheet1 ), Sheet1[Year] = PreviousYear_ ) ) VAR MinYear_ = CALCULATE ( MIN ( Sheet1[Year] ), ALL ( Sheet1 ) ) RETURN IF ( CurrentYear_ <> MinYear_, CurrentProfit_ - PreviousProfit_ )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 4 years ago
Hi milkywaypowerbi ,
Just create another measure like so:
Profit Diff 2 = SUMX(Sheet1,[Profit Diff])Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Sorry I am a bit confuse by using a separate table. I created another table for year
Here is the link to the powerbi file
:https://drive.google.com/drive/folders/1_iiFNWrVGAyAhHY5hWnSbETcNGygRMYJ?usp=sharing
Can you please help me on the file.
Thank you so much!
milkywaypowerbi , whenever we create time intelligence we prefer a separate table like a date table joined with date of the table if you have data only at year level a year table joined on year.
- milkywaypowerbi4 years agoHelper II
Hi amitchandak
I have created another table for the year but the codes are different from my naming so I am getting errors since I am unsure is it referring to the year in revenue sheet or date
Can you please assist with my table names? Thanks!