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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kodalisatish
Frequent Visitor

Difference between two rows with multiple filters

I am trying to build a report to show the percent change form same quarter one year prior with the following data. I tried to generate the difference using a DAX formula(Column and Measure) but couldn't get it to work.

 

 

State Values Year Quarter
DC 185 2017 q4
ME 339 2017 q4
MA 2036 2017 q4

DC 186 2017 q3
ME 393 2017 q3
MA 2034 2017 q3

DC 196 2017 q2
ME 426 2017 q2
MA 2370 2017 q2

DC 183 2017 q1
ME 304 2017 q1
MA 2075 2017 q1

DC 172 2016 q4
ME 327 2016 q4
MA 1977 2016 q4

DC 184 2016 q3
ME 387 2016 q3
MA 2168 2016 q3

DC 179 2016 q2
ME 440 2016 q2
MA 2308 2016 q2

DC 160 2016 q1
ME 387 2016 q1
MA 2121 2016 q1

DC 174 2015 q4
ME 399 2015 q4
MA 2269 2015 q4

I am a new user of powerbi, any help is appreciated. I am open to formatting the data differently if that helps.

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

Hi@ kodalisatish 

After my research , you can do these follow my steps like below:

Step 1:

Add two measure

Measure = CALCULATE(SUM(Table1[Values]))
Measure 2 = var maxy=MAX(Table1[Year]) return CALCULATE(SUM(Table1[Values]),Table1[Year]=maxy-1)

Step 2:

Add difference

Difference = [Measure]/[Measure 2]

Step 3:

Drag Year ,Quarter ,Difference and other fields into table visual

 

Result:

9.png10.png

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-lili6-msft
Community Support
Community Support

Hi@ kodalisatish 

After my research , you can do these follow my steps like below:

Step 1:

Add two measure

Measure = CALCULATE(SUM(Table1[Values]))
Measure 2 = var maxy=MAX(Table1[Year]) return CALCULATE(SUM(Table1[Values]),Table1[Year]=maxy-1)

Step 2:

Add difference

Difference = [Measure]/[Measure 2]

Step 3:

Drag Year ,Quarter ,Difference and other fields into table visual

 

Result:

9.png10.png

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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