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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
gonrodrigues
Helper III
Helper III

Variation Column

Hello!

 

Var headcount.jpg

QP Var.jpg

 

I need to create a new column in "Variação" (variation in english) table, called "Var Headcount" in which the 1st row is:

 

[nr of rows with 'domingo, 1 de Maio de 2016' associated in 'QP' table] - [nr of rows with 'sexta-feira, 1 de Abril de 2016' associated in 'QP' table]

 

2nd row:

 

[nr of rows with 'sexta-feira, 1 de Abril de 2016' associated in 'QP' table] - [nr of rows with 'terça-feira, 1 de Março de 2016' associated in 'QP' table]

 

and so on...

 

How can i do this?

 

Thanks!

1 ACCEPTED SOLUTION
sornavoor
Resolver I
Resolver I

Please see the below if it works for you.... 

 

2 Steps:  

 

Step 1 Count of related rows as a column in Date Table:

QP Row Count = IF(COUNTROWS(RELATEDTABLE(QP))>0,COUNTROWS(RELATEDTABLE(QP)), 0)

 

Step 2: Difference in Count from Prior Month:

 

Difference From Prior Month = 'Date Table'[QP Row Count] - CALCULATE(SUM('Date Table'[QP Row Count]),DATEADD('Date Table'[Date],-1,MONTH))

 

 

 


Data ModelData ModelQP TableQP Table

Step 1 - Add a Related Row Count ColumnStep 1 - Add a Related Row Count ColumnStep 2 - Add  a Difference in Row Count from prior MonthStep 2 - Add a Difference in Row Count from prior Month

View solution in original post

2 REPLIES 2
sornavoor
Resolver I
Resolver I

Please see the below if it works for you.... 

 

2 Steps:  

 

Step 1 Count of related rows as a column in Date Table:

QP Row Count = IF(COUNTROWS(RELATEDTABLE(QP))>0,COUNTROWS(RELATEDTABLE(QP)), 0)

 

Step 2: Difference in Count from Prior Month:

 

Difference From Prior Month = 'Date Table'[QP Row Count] - CALCULATE(SUM('Date Table'[QP Row Count]),DATEADD('Date Table'[Date],-1,MONTH))

 

 

 


Data ModelData ModelQP TableQP Table

Step 1 - Add a Related Row Count ColumnStep 1 - Add a Related Row Count ColumnStep 2 - Add  a Difference in Row Count from prior MonthStep 2 - Add a Difference in Row Count from prior Month

Worked perfectly!!!

 

Thanks a lot @sornavoor 🙂

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.