Forum Discussion
Yonah
Helper II
1 year agoIgnore selection of certain value
On my report page, I have a bar chart with different countries and a total column. I did this via ‘All_Countries_Plan = UNION(Distinct(Account[Country]),{’Gesamt"})’ Where ‘Gesamt’ = Total....
- 1 year ago
Hi Yonah
Measures must always return a scalar value one way or another. These two return a table with multiple values.
ALL(‘All_Country_Plan’) VALUES(‘All_Country_Plan’))I am not sure what exactly you're trying to calculate but this is the correct use:
IF ( -- Check if the selected country is "Total" SELECTEDVALUE ( 'All_Country_Plan'[Country] ) = "Total", -- If "Total" is selected, calculate the measure ignoring all filters on 'All_Country_Plan' CALCULATE ( [my measure], ALL ( 'All_Country_Plan' ) ), -- Otherwise, return the measure as is, keeping existing filters [my measure] )
danextian
Super User
1 year agoHi Yonah
Measures must always return a scalar value one way or another. These two return a table with multiple values.
ALL(‘All_Country_Plan’)
VALUES(‘All_Country_Plan’))
I am not sure what exactly you're trying to calculate but this is the correct use:
IF (
-- Check if the selected country is "Total"
SELECTEDVALUE ( 'All_Country_Plan'[Country] ) = "Total",
-- If "Total" is selected, calculate the measure ignoring all filters on 'All_Country_Plan'
CALCULATE (
[my measure],
ALL ( 'All_Country_Plan' )
),
-- Otherwise, return the measure as is, keeping existing filters
[my measure]
)
Yonah
Helper II
1 year agodanextian
I want to achieve exaktly, what you are doing with your soulotion,
but I'dont want to modify all my measuers.
There for, I want to have a scalar value (List of Countrys) that don't change if "Gesamt" is selected.
But its look like, I have to change the measuers instad.