Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
akshbhala
New Member

Diagonal Calculation with multiple columns and dates involved

Hi, I am trying to solve an interesting and challenging problem. 

mth  1.C2.A3.B4.D 5.E
2021-09  11004800   
2021-10  200030004000  
2021-11  3000400060007000 
2021-12  40005000700090001000

 

I want to calculate diagonally and show the ouput as below 
Note : I have also given new column names

mth    0-11-22-33-4
2021-10  273%83.3%  
2021-11  200.0%50.0%57.1% 
2021-12  60.0%57.1%66.7%700.0%

 

Formula : (row 2, column 2)  3000 /  (row1,column1) 1100 = 273%

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @akshbhala,

You can do unpivot columns on your fields to convert them to attribute and value, then remove the character to only keep number in your attribute fields.

Unpivot columns - Power Query | Microsoft Learn

After these steps, you can create segment table with different ranges and use with raw table field and new table segment to create matrix. Then you can write a measure to look up and calculate value based on current category and segment.

Dynamic segmentation – DAX Patterns
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @akshbhala,

You can do unpivot columns on your fields to convert them to attribute and value, then remove the character to only keep number in your attribute fields.

Unpivot columns - Power Query | Microsoft Learn

After these steps, you can create segment table with different ranges and use with raw table field and new table segment to create matrix. Then you can write a measure to look up and calculate value based on current category and segment.

Dynamic segmentation – DAX Patterns
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
HoangHugo
Solution Specialist
Solution Specialist

Hi,

row number or column number are relative things, you should have a exact definition for thes rows, columns

example: row 2 is current month and row 1 is prevous month, and column 2 is current week, and column 1 is previous week. That possible make DAX function 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.