Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
let's say I have matrix table visual with months in rows and countries in columns, and in filter I choose which countries I want to compare.
I need to get column (red in picture) that will calculate % difference between selected countries and that depends on what country I choose in filter.
Solved! Go to Solution.
Hi @Ninna
You can activate and rename the total column then place the following measure in the matrix instead of the original measure
ResultMeasure =
VAR NormalValue = [OriginalMeasure]
VAR SelectedCountries =
ALLSELECTED ( 'Table'[Country] )
VAR Country1 =
MAXX ( SelectedCountries, 'Table'[Country] )
VAR Country2 =
MINX ( SelectedCountries, 'Table'[Country] )
VAR Country1Value =
CALCULATE ( [OriginalMeasure], 'Table'[Country] = Country1 )
VAR Country2Value =
CALCULATE ( [OriginalMeasure], 'Table'[Country] = Country2 )
VAR Difference = Country2Value - Country1Value
RETURN
IF ( HASONEVALUE ( 'Table'[Country] ), NormalValue, Difference )
Hi @Ninna
You can activate and rename the total column then place the following measure in the matrix instead of the original measure
ResultMeasure =
VAR NormalValue = [OriginalMeasure]
VAR SelectedCountries =
ALLSELECTED ( 'Table'[Country] )
VAR Country1 =
MAXX ( SelectedCountries, 'Table'[Country] )
VAR Country2 =
MINX ( SelectedCountries, 'Table'[Country] )
VAR Country1Value =
CALCULATE ( [OriginalMeasure], 'Table'[Country] = Country1 )
VAR Country2Value =
CALCULATE ( [OriginalMeasure], 'Table'[Country] = Country2 )
VAR Difference = Country2Value - Country1Value
RETURN
IF ( HASONEVALUE ( 'Table'[Country] ), NormalValue, Difference )
Great, that is it. Thanks 🙂
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |