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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Danhartzi
Regular Visitor

How to arrange the dates?

Hey guys.
I have two tables.

One - showing products yearly budget when each column represents the related month:

Danhartzi_0-1681291704920.png

Two - showing products yearly actual expenses when each line has its own month (of course summed up with sumx to show sums):

Danhartzi_1-1681291812651.png


Showing YTD to the second table is simple using SUMX because the only lines I will have are the actuals months that include expenses in. But how do I do YTD to the first table? How can I give it a reference to the month we are at right now?

Thank you in advance !

1 ACCEPTED SOLUTION

Hey Daniel,

 

Ah I see, you also have a second data modeling issue, in my opinion: you're creating a relationship between two fact tables. (Additional reading about star schemas if you're interested in the data modeling. A bit lengthy but SQLBI is my go-to for Power BI things.). Here is a super small mockup of what I would do instead.

 

What I have is the budget table unpivoted, then a calculated table with all the unique combinations of the internal key (with a few other columns you might want to work with; feel free to remove or add columns of course). That calculated table is the "dimension table" that has the one-to-many relationship with both the actual and budget tables. I also threw in a sample Calendar table.

 

This is what my data model looks like:

Wilson__0-1681304106073.png

 

This is what my visual looks like:

Wilson__1-1681304129025.png

Hopefully that works for you. 😄


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
Wilson_
Super User
Super User

Hello Dan,

 

The simplest solution would be to unpivot the first table (ideally in the original data source, but also possible in Power Query). That way, you will end up with your data in the same format as the second table. Power BI generally works better with tall (fewer columns, more rows) tables than wide (more columns, fewer rows) tables anyway.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hey Wilson and thank you for the quick reply !

Trying to further explain my problem here..
The budget (first table) as seen has columns for each P (months) but also has a internal ID system as follows:

Danhartzi_0-1681301430695.png

As you can see the 4th column takes the CC first, adds the Product name and then adds the GL.
This creates a unique Internal ID so that I can connect those tables as seen here :

Danhartzi_1-1681301529656.png

If I unpivote this unique column would no longer be unique since every single Internal ID now has a few rows to it (for each P/month).

Any other ideas maybe to solve this issue?

Thank you !
Daniel

Hey Daniel,

 

Ah I see, you also have a second data modeling issue, in my opinion: you're creating a relationship between two fact tables. (Additional reading about star schemas if you're interested in the data modeling. A bit lengthy but SQLBI is my go-to for Power BI things.). Here is a super small mockup of what I would do instead.

 

What I have is the budget table unpivoted, then a calculated table with all the unique combinations of the internal key (with a few other columns you might want to work with; feel free to remove or add columns of course). That calculated table is the "dimension table" that has the one-to-many relationship with both the actual and budget tables. I also threw in a sample Calendar table.

 

This is what my data model looks like:

Wilson__0-1681304106073.png

 

This is what my visual looks like:

Wilson__1-1681304129025.png

Hopefully that works for you. 😄


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.