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
topazz11
Helper III
Helper III

adding variance into table

is there a way to add variance between current and prior into the table?

current and prior data are in the same table but I am not sure how to add the variance data.

Thank you,

 

typegroupgroup2colornamevalue1value2value3value4value5
currentaaagroup name1color name12name355556
currentcccgroup name2color name13name455558
currentbbbgroup name3color name14name556786
currentdddgroup name4color name15name655958
currentcccgroup name5color name16name798556
currentbbbgroup name6color name17name899556
currentdddgroup name7color name18name9551056
currentcccgroup name8color name19name10855446
currentbbbgroup name9color name20name117555533
currentdddgroup name10color name21name1265556
prioraaagroup name1color name12name323456
priorcccgroup name2color name13name432549
priorbbbgroup name3color name14name5416312
priordddgroup name4color name15name6507215
priorcccgroup name5color name16name76-18118
priorbbbgroup name6color name17name87-29021
priordddgroup name7color name18name98-310-124
priorcccgroup name8color name19name109-411-227
priorbbbgroup name9color name20name1110-512-330
priordddgroup name10color name21name1211-613-433
variance         
variance         
variance         
variance         
variance         
variance         
variance         
variance         
variance         
variance         
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @topazz11 

 

Instead of adding extra rows to your data and potentially slow down refresh and increase your semantic model's footprint, use calculation groups instead so the same logic is applied to the measures added to a visual. Please see the attached sample pbix.

danextian_0-1746880578319.png

danextian_1-1746880649159.png

danextian_2-1746880671216.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

7 REPLIES 7
danextian
Super User
Super User

Hi @topazz11 

 

Instead of adding extra rows to your data and potentially slow down refresh and increase your semantic model's footprint, use calculation groups instead so the same logic is applied to the measures added to a visual. Please see the attached sample pbix.

danextian_0-1746880578319.png

danextian_1-1746880649159.png

danextian_2-1746880671216.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you, this works. I have never used this before.  how does it filter current, prior or variance without relationship? it is mystery..

topazz11
Helper III
Helper III

I am trying to add all in one page and have them change dynamically based on the slicer.

 

dell.PNG

ToddChitt
Super User
Super User

Question: Why do you want to have the Variance on additional ROWS, not as calculated a Column? Better yet, a set of MEASURES for SUM (Current}, SUM (Prior). Then Variance is just another measure

= SUM(Current) - SUM(Prior)

 

Putting Variance on its own set of rows does not seem logical. Do you have a pressing need to do it that particular way? If so, I would be curious to know the reason.

 




Did I answer your question? If so, mark my post as a solution. Also consider helping someone else in the forums!

Proud to be a Super User!





I'm trying to display tables in one page using a slicer, allowing users to select 'Current', 'Prior', or 'Variance' and display the corresponding page based on their selection

dell.PNG

rohit1991
Super User
Super User

Hi @topazz11 

Yes, you can add a variance row to your table by calculating the difference between the "current" and "prior" values for each corresponding row. Since both current and prior data are in the same table, you’ll need to group them by a common identifier—in your case, fields like name, group, or a combination that uniquely matches each pair. You can create a new table or Power BI measure that joins the current and prior rows by these identifiers, and then subtract the prior values from the current ones to compute variance for each of the value1 to value5 columns.

 

This could be done using Power Query (M) by pivoting and merging the current and prior rows, or using DAX if you're working with calculated tables or measures. Once the variance is calculated, you can append those rows back into your main table or display them in a visual alongside the original data. This approach will allow you to easily analyze differences over time or between data snapshots. Let me know if you’d like step-by-step guidance for Power BI or Excel.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

yes, please guide me. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

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.