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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Mister_PowerBI
Frequent Visitor

How to convert a table to one that is easier to work with

Hello everybody, 

 

I've been trying to find a solution for this problem for a while now, and I am not able to figure it out. I am hoping there are some Power BI Experts that can help me out with this one.

 

I have a table like below containing invoicing rules like this (with sample data): 

 

CustomerItemPriceFromTill (made with DAX)
JohnSpotify€ 1002-2022 05-2022
JohnNetflix€ 806-2022 
John Spotify€ 1205-2022 
ThomasSpotify€ 1002-2022 
ThomasNetflix€ 805-202206-2022
ThomasNetflix€ 1506-2022 

 

Because I find it very hard to analyse this date (especially because it is combined with other tables), I would like to convert this to a table like below for the coming two years: 

 

CustomerItemPriceMonth
JohnSpotify€ 1002-2022
JohnSpotify€ 1003-2022
JohnSpotify€ 1004-2022
JohnNetflix€ 806-2022
John Spotify€ 1205-2022
John Spotify€ 1206-2022
ThomasSpotify€ 1002-2022
John Spotify€ 1203-2022
John Spotify€ 1204-2022
John Spotify€ 1205-2022
John Spotify€ 1206-2022
ThomasNetflix€ 805-2022
ThomasNetflix€ 1506-2022

 

Based on this second table, it is way easier to combine the price for a specific month with the amount of users and some other data that affects the overall income. But I can't find a way to create table 2 based on the data in table 1.

 

Does anybody have any idea on how to add a table 2 to the datamodel?

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

Hi , @Mister_PowerBI 

Based on the data you provided, it's hard for me to see what rules table2 is based on.

And the [Till] i think it is created by the other table by dax like a calculated column .

vyueyunzhmsft_0-1675387498385.png

The first line is from February to February, but below there is only February to April. Is there a deviation in my understanding of your needs?

Second, if you want to generate a new table with start and end dates, you can use the GenerateSeries or calendar functions to generate a date table for each row, and then use crossjoin() to merge them.

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the right desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @Mister_PowerBI 

Based on the data you provided, it's hard for me to see what rules table2 is based on.

And the [Till] i think it is created by the other table by dax like a calculated column .

vyueyunzhmsft_0-1675387498385.png

The first line is from February to February, but below there is only February to April. Is there a deviation in my understanding of your needs?

Second, if you want to generate a new table with start and end dates, you can use the GenerateSeries or calendar functions to generate a date table for each row, and then use crossjoin() to merge them.

 

 

 

If this method does not meet your needs, you can provide us with your special sample data and the right desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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