cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PDV
Helper I
Helper I

Show Delta between a selected item from a Column and the other rows items

Hi,

 

I need to provide a visualization and a table of the delta between one selected item's value and all the others. (p.s.: the table is used in other views and I cannot directly pivot or change it at source).

Source

itemscenariovalue
AWWW3
AEEE5
ATTT1
BWWW3
BEEE6
BTTT1
CWWW7
CEEE5
CTTT1
DWWW3
DEEE5
DTTT1

 

Selection : A

Expected outcome:

 

Outcome
itemscenarioDelta
BEEE1
CWWW4

 

(and the same outcome to be shown in a column chart)

 

Any ideas?

 

Thanks,

 

Pietro

 

1 ACCEPTED SOLUTION
mahoneypat
Super User
Super User

To do this, you'll need to make a disconnected table of your Items to be used in the slicer.  You can then use this measure to get your desired result.

 

Slicer = DISTINCT(Delta[item])
 

mahoneypat_0-1621560816450.png

Show Delta =
VAR selitem =
    SELECTEDVALUE ( Slicer[item] )
VAR thisvalue =
    SUM ( Delta[value] )
VAR thisscenario =
    MIN ( Delta[scenario] )
VAR selvalue =
    CALCULATE ( SUM ( Delta[value] ), Delta[item] = selitem )
VAR result = thisvalue - selvalue
RETURN
    result

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

1 REPLY 1
mahoneypat
Super User
Super User

To do this, you'll need to make a disconnected table of your Items to be used in the slicer.  You can then use this measure to get your desired result.

 

Slicer = DISTINCT(Delta[item])
 

mahoneypat_0-1621560816450.png

Show Delta =
VAR selitem =
    SELECTEDVALUE ( Slicer[item] )
VAR thisvalue =
    SUM ( Delta[value] )
VAR thisscenario =
    MIN ( Delta[scenario] )
VAR selvalue =
    CALCULATE ( SUM ( Delta[value] ), Delta[item] = selitem )
VAR result = thisvalue - selvalue
RETURN
    result

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors