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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
will1296
Frequent Visitor

Dividing rows

Hi,

 

Im new to power BI and am facing some problems here.

I have a table like this:

 

CAMPTYPEITEMUNITS
201701AApple100
201702BLemon50
201702AApple1000

 

I'd like to proportion breakdown the units to previous month, current month and next month, so that I have a dynamic table that looks like this:

 

CAMPITEMUNITSREMARK
201612Apple30M1
201701Apple50M2
201702Apple20N2
201702Lemon45N1
201703Lemon5N2
201701Apple300M1
201702Apple500M2
201703Apple200N2

 

So, the each CAMP column is breakdown into previous month, current month and next month and the units are breakdown as below table. If the TYPE column is A, then breakdown the units with matrix [0.3,0.5,0.2], and remark M1, M2, N1 or N2 corresponding to the the table. The breakdown index is as below table:

 

A B 
30%M190%N1
50%M210%N2
20%N2  

 

I've been trying to write a DAX formula to convert this, but it doesnt work, and I've been stuck on this for days. Can anyone point me in the right direction as to DAX to split out units into the second table?   

Thanks in advance.

1 ACCEPTED SOLUTION

Hi @will1296,

 

For BreakDown table, I changed its structure to make it more usable.

2.PNG

 

In CAMP table, I added some auxilliary columns as highlighted in below image.

1.PNG

 

Then, I make PreviousMonth, CurrentMonth and NextMonth records to be listed in a single column via UNION. And use LOOKUPVALUE function to refer to BreakDown value in BreakDown table.

 

For more detailed steps, please see the attached .pbix file. CAMP Table_2 is the result table.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
will1296
Frequent Visitor

Hi,

 

Im new to power BI and am facing some problems here.

I have a table like this:

 

CAMPTYPEITEMUNITS
201701AApple100
201702BLemon50
201702AApple1000

 

I'd like to proportion breakdown the units to previous month, current month and next month, so that I have a dynamic table that looks like this:

 

CAMPITEMUNITSREMARK
201612Apple30M1
201701Apple50M2
201702Apple20N2
201702Lemon45N1
201703Lemon5N2
201701Apple300M1
201702Apple500M2
201703Apple200N2

 

So, the each CAMP column is breakdown into previous month, current month and next month and the units are breakdown as below table. If the TYPE column is A, then breakdown the units with matrix [0.3,0.5,0.2], and remark M1, M2, N1 or N2 corresponding to the the table. The breakdown index is as below table:

 

A B 
30%M190%N1
50%M210%N2
20%N2  

 

I've been trying to write a DAX formula to convert this, but it doesnt work, and I've been stuck on this for days. Can anyone point me in the right direction as to DAX to split out units into the second table?   

Thanks in advance.

Hi @will1296,

 

For BreakDown table, I changed its structure to make it more usable.

2.PNG

 

In CAMP table, I added some auxilliary columns as highlighted in below image.

1.PNG

 

Then, I make PreviousMonth, CurrentMonth and NextMonth records to be listed in a single column via UNION. And use LOOKUPVALUE function to refer to BreakDown value in BreakDown table.

 

For more detailed steps, please see the attached .pbix file. CAMP Table_2 is the result table.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yulgu-msft
Employee
Employee

Hi @will1296,


A B
30% M1 90% N1
50% M2 10% N2
20% N2    

 


 

Please post the correct table structure of the breakdown index table. Show us column headers and detailed records.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft

Thanks for your notice 🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.