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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
zb134
Helper I
Helper I

Showing changes in a value over time in a table columnwise when the source data is spread over rows

Sorry if the title doesn't make sense. I think the tables below should clear it up:

Source Table:

(Note that in the actual dataset there are 30+ other columns and close to 300 rows that cover multiple quarters)

Item    ValueXDate
123Lvl 12022 Q3
213Lvl 12022 Q3
312Lvl 22022 Q3
123Lvl 22022 Q4
213Lvl 12022 Q4
312Lvl 32022 Q4

 

What I want to show in the table visualization is only the items that have had a change in ValueX over the previous quarter. So using the above example it should look like:

ItemValueX Previous Quarter

ValueXCurrent

123Lvl1Lvl2
312Lvl2Lvl3

Item 213 would be excluded since it did not have a change in value X.

Any suggestions are highly appreciated!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

First of all thanks a lot. Took a bit of tweaking to figure out what you did and apply it to my use case but it worked wonderfully! Super grateful for you help.

 

Now, if I may, can I ask a follow-up clarification:

 

You used the calculation: 

Value in previous quarter = CALCULATE([Value],PREVIOUSQUARTER('Calendar'[Date])) 

 

Why is there the need to create the 'Calendar' table?

I tried replicating the function using the existing date field in the Data table but it doesn't work

Value in previous quarter = CALCULATE([Value],PREVIOUSQUARTER(Data[Date]))

What makes the Calendar.Date work but not the Data.Date?

 

I also tried using

 Value in previous quarter = CALCULATE([Value],'Data'[Date] IN { DATE(2022, 9, 1) }

This worked somewhat but would not allow fo the use of slicers and obviously isn't as useful as your function since it reference a static date that will have to be change all the time.

 

Just trying to learn!

 

Thanks!!!!!!
)

You are welcome.  A Calendar table allows the usage of Date and Time Intelligence functions and allows you to create relationships with other Fact tables (which have a Date column).  The reason (probably) Data[Date] does not work is that for Date and Time Intelligence functions to work, there should be a continuous range of dates.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.