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
renanc
Helper II
Helper II

Comparison between values in another row

Hi guys, I'm trying to get the same values of the last column, called "SUM GROUP", but in a different order condition, and fulfill its values in column "IF SUM". As you can see, I have two months column:


tegma prob.JPG

1) one with the current month "MES_DISPOTIVO"
2) The other with the current month + 6 (months), for example: month [1] (jan) + 6 = month [7] (Jul)
3) Last there's a column called "COUNT" which I have to cross the values with "SUM GROUP" So in other words what Im trying to do is exactly the same as "IF SUM" column, but not all the values are appearing with this formula, I even tried firstnonblank.


For example:
So basically Im trying to get, when month is equal to 1, add +6 months, which will be for example the "MES_DISPOTIVO" with a value of seven (1+6) = 7, and cross the value that i got in the column "sum group" line 1 = 127, but I want this in month 7, so six months after my column month, I need this in WHOLE "IF SUM" column, theses values fulfilled. 

However not all the values are appearing because I cant match the months comparison, We are in month 8, so I'm not getting the comparison of "MES_DISPOTIVO", despite the support column all values with +6 added, in the current month we are in month 8, so I cant cross for example the line where the "MES_DISPOTIVO", value is equal 3 and "MES_DISPOTIVO" = 9, because we are in month 8, so I need to figure out another way to do it:
I've already did it in another support table, but I couldn't match the values of the column "COUNT" that I also have to compare and subtract.  (the column "COUNT" have to be kept without changing its sort order, it doesnt need modification).

 

To put it simply, I just needed to subtract in each month, the count of six months ago. So in July I need to subtract the count of January. So the challenge here is how to show the count of january in July's row. Keeping in mind that 

 

Thanks a lot for the attention!

2 REPLIES 2
amitchandak
Super User
Super User

@renanc , Can you share sample data and sample output in table format?

 

hey @amitchandak 
I made a sample with everything that I got for this problem with a PBI desktop, even the calculated columns.
I did some trials that almost did the job in SUP table, but the COUNT also changed its order, so it was irrelevant =/

renanc_0-1596823122361.png
The table with original data is: "vw_TG_Sample"

 

Anyway, the link for download with pbi content:
https://drive.google.com/file/d/1-DrBkkATXkdu2TAZ0wFxc5uqyhvqXkeU/view?usp=sharing 

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.