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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Help the doctor (me)) visualize vitamins and minerals in all food.

Hello,

 

There is freely available data on the official website of the US Department of Agriculture on the content of vitamins and minerals... for all products. https://fdc.nal.usda.gov/download-datasets

I'm trying to download and convert the data "Full Download of All" CSV 449M, but I can't even visualize it, let alone understand where to look for "Turkey Meat" and what is included in 100 grams.
I would like to get a visualization like in the picture.

Turkey Meat.png

Help me, how to make such a visualization step by step and save the data in an acceptable format for each member of my family, well, and for all interested participants of this forum.

 

Respectfully,
Evgeny

5 REPLIES 5
Anonymous
Not applicable

How to summarize and visualize all the kilocalories, proteins, fats, carbohydrates and other macro- and micronutrients in the products that you ate and drank throughout the day from the reference values ​​of the norm?

 

For all family members?


Thank you very much Mr. Zhu!

Anonymous
Not applicable

Found something similar in a spreadsheet 400 kb https://sourceforge.net/projects/nutritional-tables/

 

But how to convert it to Power BI?

Hi @Anonymous ,

 

Minerals as an example, first of all in Excel on the data to carry out simple processing, delete unnecessary rows:

vlinhuizhmsft_0-1738917408727.png

vlinhuizhmsft_1-1738917435800.png

After getting the data from EXCEL, click Transform data in Power BI to enter Power Query Editor. Select the columns other than minerals and unpivot them:

vlinhuizhmsft_2-1738917705501.png

Do the same for the other table:

vlinhuizhmsft_3-1738917857704.png

Merge two tables together:

vlinhuizhmsft_4-1738917976647.png

vlinhuizhmsft_5-1738918058950.png

Create a measure to get the ratio to the reference value:

Percentage = DIVIDE(MAX('Minerals_Merge'[Value]),MAX('Minerals_Merge'[Minerals.Value]))

 

Create the visual as shown:

vlinhuizhmsft_6-1738918391502.png

 

You can also create slicers to filter for different things, minerals, people, etc.
Result:

vlinhuizhmsft_7-1738918517066.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

Anonymous
Not applicable

Thank you very much dear Mr. Zhu!


Allow me not to mark your comment as a solution yet?
I want to understand how to sort all the data correctly.
Start learning M language in Power Query?


Thanks again, you spent your time!

v-linhuizh-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to the link you provided, I imported the three tables: food ,food_nutrient and nutrient, and due to the large amount of data, I'm only using some of them:

 

vlinhuizhmsft_0-1737439878018.png

 

Create relationships for the three tables:

vlinhuizhmsft_1-1737440050219.png

 

Then create a measure:

Rate = DIVIDE(SUM('food_nutrient'[amount]),CALCULATE(SUM('food_nutrient'[amount]),ALLSELECTED('food_nutrient'),'nutrient'[unit_name]=MAX('nutrient'[unit_name])))

 

Result:

vlinhuizhmsft_2-1737440280682.png

 

You can modify it to suit your specific needs, the links related to data modeling are as follows:

Understand star schema and the importance for Power BI - Power BI | Microsoft Learn

Data reduction techniques for Import modeling - Power BI | Microsoft Learn

 

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.