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
krwalke
Frequent Visitor

Combining Two Date Fields In A Measure or Table?

Hi Everyone,

 

I've been scratching my brain for too long and need to ask for help on this one. I have two queries with dates and specific values, that I have put in visuals.  

 

krwalke_1-1673884515932.png

Table 1 (top) is Revenue

Table 2 (bottom) is Spoilage

 

What I'd like to do is simply take my Spoilage and divide it by Revenue to get a % Spoilage, in a visual (preferably the same as Table 2).

 

What I'm running into is that the date field for Table 1 and Table 2 are different, and they must stay different.

 

I believe I need to get these two data sets to have a common x-axis (date axis) before I can divide one from another.  Ideally, I would just tranform the date fields for each into Month Year format, but I'm struggling with the best way to do it.  Bins?  Group by?  In Power Query or not?

 

This seems like it should be simple, but I can't get it.  Any help would be appreciated!  Thanks!

 

Kevin

 

1 REPLY 1
DataInsights
Super User
Super User

@krwalke,

 

Does your model have a date table? If not, see the article below. The concept is to create a date table that is shared by all fact tables in your model. Create a relationship between the date table and each of your two queries, and use date table fields in your visuals.

 

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/ 





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

Proud to be a Super User!




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.

Top Solution Authors