Matrix calculus - specific formula for matrix

Hi,
I want to calculate the difference in values between versions of files in matrix visualization. I tried to present it as simply as possible on a picture. I am also including the pbx file

Sample.pbix (126.0 KB) Sample.xlsx (487.1 KB)

Hi @Harris, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.

  • When posting a topic with formula make sure that it is correctly formatted to preformated text </>.

  • Use the proper category that best describes your topic

  • Provide as much context to a question as possible.

  • Include demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Hi Harris,

That was quite a thinking :joy:
Why don’t you try this solution?

Sample_v2.pbix (194.5 KB)

Data:
image

Outcome:
image

The following steps were taken:

  1. Modify data table in power query.
    a) Each file data are presented in separate column.
    b) Information about file name is kept on the row level.

image

  1. Create measure that sum values and removes filter from file name.
File_1v =
CALCULATE (
    SUM ( 'Arkusz1_support'[File 1] ),
    REMOVEFILTERS ( 'Arkusz1_support'[File] )
)
  1. Final Measure:
File_1 =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Arkusz1_support'[File] ) = "File 1", [File_1v] -[File_1v],
    SELECTEDVALUE ( 'Arkusz1_support'[File] ) = "File 2", [File_1v] -[File_2v],
    SELECTEDVALUE ( 'Arkusz1_support'[File] ) = "File 3", [File_1v] -[File_3v],
    SELECTEDVALUE ( 'Arkusz1_support'[File] ) = "File 4", [File_1v] -[File_4v],
    BLANK ()
)

The measures was repeated as many times as different file names.
If there are much more files than another solutions would be advised.

I hope all is clear :slight_smile:

Take care,
Mariusz

1 Like