Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello Experts,
Could you please help me with this issue?
I have a table with monthly sales by Year/Month, like this
product code | description | year | Jan | feb | Mar | Apr | May | jun | Jul | Aug | Sep | Oct | Nov | Dec |
M01 | Product A | 2019 | 10 | 12 | 22 | 32 | 12 | 10 | 56 | 23 | 60 | 65 | 90 | 98 |
M01 | Product A | 2020 | 8 | 15 | 16 | 18 | 25 | 54 | 24 | 65 | 89 | 120 | 100 | 125 |
M02 | Product B | 2019 | 3 | 13 | 25 | 21 | 17 | 87 | 98 | 34 | 54 | 26 | 43 | 55 |
M02 | Product B | 2020 | 15 | 32 | 54 | 56 | 76 | 54 | 56 | 43 | 22 | 90 | 18 | 130 |
Then, I need generate a new row below each product with the Variation 2020 minus 2019 for each month.
Something like this:
I tried using a matrix, but it only make a sum of the values for each month, Is possible change it to generate a row with variation 2020 minus 2019?..
Solved! Go to Solution.
@gomezc73 - Put together a more concrete example for you with your data. The quick measure basically discusses the concept of how to do it, how to use HASONEVALUE, ISINSCOPE, etc. to find out where you are in the hierarchy/matrix and then you can decide how to do your calculation accordingly. See attached PBIX beneath sig. Page 6, Table (6), Measure 6.
Measure 6 =
VAR __productcode = MAX([product code])
VAR __description = MAX([description])
VAR __year = MAX([year])
VAR __Month = MAX([Attribute])
VAR __2019 = SUMX(FILTER(ALL('Table (6)'),[product code]=__productcode && [description]=__description && [Attribute]=__Month && [year]=2019),[Value])
VAR __2020 = SUMX(FILTER(ALL('Table (6)'),[product code]=__productcode && [description]=__description && [Attribute]=__Month && [year]=2020),[Value])
RETURN
IF(ISINSCOPE([year]),SUM([Value]),__2020 - __2019)
@gomezc73 - You want MM3TR&R - https://community.powerbi.com/t5/Quick-Measures-Gallery/Matrix-Measure-Total-Triple-Threat-Rock-amp-...
Thanks fot your help, It can help is very similar. but i am not an expert user.. Sorry!!. Is very complicated to modified the formula to generated the difference insted MIN/Max or AVE?
@gomezc73 - Put together a more concrete example for you with your data. The quick measure basically discusses the concept of how to do it, how to use HASONEVALUE, ISINSCOPE, etc. to find out where you are in the hierarchy/matrix and then you can decide how to do your calculation accordingly. See attached PBIX beneath sig. Page 6, Table (6), Measure 6.
Measure 6 =
VAR __productcode = MAX([product code])
VAR __description = MAX([description])
VAR __year = MAX([year])
VAR __Month = MAX([Attribute])
VAR __2019 = SUMX(FILTER(ALL('Table (6)'),[product code]=__productcode && [description]=__description && [Attribute]=__Month && [year]=2019),[Value])
VAR __2020 = SUMX(FILTER(ALL('Table (6)'),[product code]=__productcode && [description]=__description && [Attribute]=__Month && [year]=2020),[Value])
RETURN
IF(ISINSCOPE([year]),SUM([Value]),__2020 - __2019)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
117 | |
75 | |
46 | |
45 | |
32 |
User | Count |
---|---|
172 | |
90 | |
66 | |
46 | |
45 |