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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Yrstruly2021
Helper V
Helper V

Calculating/Dividing Two Pivot Tables

I am using excel to create pivot tables and than divide the tableIs to get desired outcome. See: https://drive.google.com/file/d/1jL4vNdBxAi0LPigy3iaQ-iGFzHiMPaBA/view?usp=sharing and https://drive.google.com/file/d/1dwPDuuOju7nbLyDVa5njvLObCqviJa3Z/view?usp=sharing

 

These questions: https://drive.google.com/file/d/1dwPDuuOju7nbLyDVa5njvLObCqviJa3Z/view?usp=sharing

i am answering in Excel currently. I would like to answer them in Powerbi. Please assist?

 

SQL i am using in Powerbi, to pull in the desired tables: 

# App Filter Categories
select a.label as 'App Category'
, b.label as 'Menu'
, c.product_uid as 'Product UID'
from app_menu_filters a
left join app_menu_filters b on b.parent_uid=a.uid
left join app_menu_filter_products c on b.uid=c.app_menu_filter_uid
where a.status='A' and a.level=1
order by 1,2,3;

# Sales and Product Data
SELECT date(o.created_datetime) as Date, od.product_uid as 'Product UID',
p.manufacturer Manufacturer, p.bmc BMC, p.brand Brand, od.label as SKUs, p.selling_unit as 'Unit of Measure',
ROUND(if(od.amended_quantity is not null, od.amended_quantity, od.quantity)) as 'Units Sold',
ROUND((if(od.amended_quantity IS NOT NULL, od.amended_quantity, od.quantity))*p.content,2) as 'Sales Volume',
ROUND((if(od.amended_quantity is not null, od.amended_quantity, od.quantity))*od.price,2) as 'Sales Value'
FROM order_detail od
left join `order` o on od.order_uid=o.uid
left join product p on od.product_uid=p.uid
where o.status in ('D',1,2,3,4,5)
and not od.label ='Plastic Bag'
and date(o.created_datetime) >= '2020-04-01'

 

Please see data in access:  https://drive.google.com/file/d/1zqSbAvESHf5WUw4U-OKXjL_9E8NbJTfd/view?usp=sharing

Please see data in excel: https://drive.google.com/drive/folders/1jUFHVlGZsHNdE6H0TuB2FI6c19Up52eR?usp=sharing

 

 

 

7 REPLIES 7
Yrstruly2021
Helper V
Helper V

It is active within the pbix.

Yrstruly2021
Helper V
Helper V

Please see PBIX file. I need to calculate the two, app category and manufacturers.

https://drive.google.com/file/d/1Bb_UPIws52ZcY_SpcsLXcEJMdZfp5t7k/view?usp=sharing 

 

Anonymous
Not applicable

Hello @Yrstruly2021 ,
Goggle Drive link is asking for access.
Can you share it properly?

Thank you. It should be working now.

Anonymous
Not applicable

Hello @Yrstruly2021 
Please make an active relationship and keep the cross filter direction to "Single". Sheet 3 should filter Sheet 1.
If you didn't get as expected then please share the expected output.
Thanks.

I believe the relationships are active?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.