cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
g_k_k
Frequent Visitor

Comparing entire row in table

Hi,

 

So far i succeeded to compare yesterday with today. But i am doing this by creating two measures, one to get the value from yesterday and one to calculate the difference between yesterday and today. In my table I have 14 columns. Is there a way to compare the whole row at once? 

 

Capture3.PNG

 

Relationships

Everything comes from a single table (and measures form that table). Date has a many to one relationship with the table.

date - 1: many - table1

 

Measures1 - get the value from yesterday

com_test = VAR PriorDay = SELECTEDVALUE(table1[date])-1

RETURN
CALCULATE(
( 'table1'[gb_total_supply]),
ALL ( table1[date]),
table1[date] = PriorDay
)

 

Measures2 - calculate the difference in %
com_test % difference from gb_total_supply =
VAR __BASELINE_VALUE = [measure1]
VAR __VALUE_TO_COMPARE = [measure2]
RETURN
IF(
NOT ISBLANK(__VALUE_TO_COMPARE),
DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
)

 

Idealistic I would like to choose a value from the first table and then that value gets compared to a static day (today) in the second table, is this even possible in power bi?

3 REPLIES 3
Super User III
Super User III

Re: Comparing entire row in table

Hi @g_k_k,

 

What is the structure of your data? How is the model setup? Depending on the configurations the answer will be different.

 

Please see this post regarding How to Get Your Question Answered Quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 (courtesy of @Greg_Deckler).


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Check out my blog: Power BI em Português


Super User IV
Super User IV

Re: Comparing entire row in table

I think you need to have that many measures. The only thing is if you need to change % only. You can create prior measure as var in that formula.





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


g_k_k
Frequent Visitor

Re: Comparing entire row in table

Thanks for your quick reply. Is there a way to make one measure from the two measures i'm currently working with?

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors