Forum Discussion

topazz11's avatar
topazz11
Helper III
1 year ago
Solved

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         

7 Replies

    • topazz11's avatar
      topazz11
      Helper III

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

  • Hi topazz11 

     

    If your goal is to display Current, Prior, and Variance on the same page and switch between them dynamically using a slicer, then the cleanest and most scalable solution is to use Calculation Groups via Tabular Editor. This lets you define one set of logic for your measures, and simply toggle between views without duplicating data or adding extra rows.

     

    It keeps your model lean, improves performance, and gives end users a smooth slicer-based experience.

    That said, if you still need to physically calculate variance rows (for audit, export, or other use cases), you can absolutely do that by:

     

    • Grouping by a common key (like name + group),

    • Joining current and prior rows in Power Query or DAX, and

    • Calculating the variance as Current - Prior.

     

     

     

  • 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.

     

    • topazz11's avatar
      topazz11
      Helper III

      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

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