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
Tycobb479
New Member

Historical line chart

Hello dear collaborators!
I'd like to kindly ask for your help regarding the following: I have the below information and I would like to calculate the subtotals for A and B and then divide [(subtotal A) / (subtotal B)] to get the values per month (the highlighted table), as my aim is to plot these monthly values in a line chart to visualize the trend. The first criteria will be to filter the info out by date (month), but I also have some codes associated to more slicers. I have tried to work this out with no success (I'm quite new using PowerBi). Is there anyone that can guide me to solve this problem? Thanks in advance!

 

PowerBI question.PNG

2 ACCEPTED SOLUTIONS
dcrow5378
Resolver I
Resolver I

You can achieve this by rolling up the date to year month format, then creating a measure to perform the calculation:

dcrow5378_0-1659991089805.png

 

 

View solution in original post

MahyarTF
Memorable Member
Memorable Member

Hi,

You could create the Month-Num column in your table as below :

Month-Num = format(Sheet81[Date], "MM")
And also 
Value = DIVIDE( sum(Sheet81[A]), sum(Sheet81[B] ))
then use the created column in your visuals :
MahyarTF_0-1660024993338.png
Mahyartf

View solution in original post

4 REPLIES 4
MahyarTF
Memorable Member
Memorable Member

Hi,

You could create the Month-Num column in your table as below :

Month-Num = format(Sheet81[Date], "MM")
And also 
Value = DIVIDE( sum(Sheet81[A]), sum(Sheet81[B] ))
then use the created column in your visuals :
MahyarTF_0-1660024993338.png
Mahyartf

Thank you for your alternative solution, MahyarTF! Much appreciatted!

dcrow5378
Resolver I
Resolver I

You can achieve this by rolling up the date to year month format, then creating a measure to perform the calculation:

dcrow5378_0-1659991089805.png

 

 

Thank you for your fast reply, dcrow5378!

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.