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
Anonymous
Not applicable

join two summarize by date

Folks: 

 

I am building an Exercise & Nutrition solution in power bi desktop.  (I am getting data from myfitnesspal.com)  The data comes in csv form.  The csvs have been pulled into the solution and are in my data model.  I also have a date dimension table where each date is a single row.

 

There are csvs (thus tables in my data model) for nutrition and exercise.  These are 1:m with the date table.  (You can exercise more then once per day - and you can eat more then once per day.)  The relationships have been set up in the model.

 

My goal now is to build a calculated table that is a summary of calories.  What I have is: 

 

Calories =
    NATURALINNERJOIN
    (
        SUMMARIZE
        (
            'Nutrition-Summary',
                'Nutrition-Summary'[Date],
                    "FoodCalories",SUM('Nutrition-Summary'[Calories]),
                    "FoodCarbs",SUM('Nutrition-Summary'[Carbohydrates (g)])
        ),
       SUMMARIZE
       (
           'Exercise-Summary',
               'Exercise-Summary'[Date],
                   "ExerciseCalories",SUM('Exercise-Summary'[Calories])
       )
)

 

Each of those SUMMARIZE statements work if executed alone.  But when I go to join them together (as you would two CTEs in SQL) I get "No common jopin columns detected.  The join function NATURALINNERJOIN requires at-least one common join column."  I want these to join on date.  How do I make that happen?

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi jflanner,

 

Please check if the data type of [Date] columns in table 'Nutrition-Summary' and table 'Exercise-Summary' are same.

 

Regards,

Jimmy Tao

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.