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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Comparing two values in two visual

Currently I have two different matrix one which has current month data and one with previous month data (the months r not actual month dates but business month date logic attached as image). I want to subtract current collection and previous collection (Sum of total amount from collection table) and show it in a third matrix  or in first or second matrix (eg :26th monday value from first matrix - 29th Monday value from second matrix this is needed for each row in the visuals(Basically like  a cell to cell subtraction in excel like A4-B4). A simple measure with Current collection - Previous collection is not working because of how the model is . Have attached some reference images . I am quite new to power BI and might be missing something obvious so any suggestion is welcome.

PowerBI_1.PNG

PowerBI_2.PNG

Akhil410_0-1620714477716.pngAkhil410_1-1620714525678.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I was able to do this calculation using the given measure hope it helps out someone in the future 

 

Akhil410_0-1620811287020.png

Please note I added this measure into the Current Month matrix and the measure calculation  is based on that .

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I was able to do this calculation using the given measure hope it helps out someone in the future 

 

Akhil410_0-1620811287020.png

Please note I added this measure into the Current Month matrix and the measure calculation  is based on that .

amitchandak
Super User
Super User

@Anonymous , Usually in such cases either on the period start date or with YYYYPP we create a rank and try to create this month vs last month

 

With a separate year period table say Date

 

new column

Period Rank = RANKX(all('Period'),'Period'[year period],,ASC,Dense)

 

measures

This Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])))
Last Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])-1))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Thank you for your response . I already have index columns created in current month and prev month table(both are of 2021) using RANKX function can that be used somehow as index 1 in both the tables are the ones to be compared(similary each index) . Also could you  plz provide some more insight on this year table concept I couldnt quite grasp it.

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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