Forum Discussion
lcasey
Post Prodigy
9 years agoWhy wont the same formula work?
Hello, I have a table I created called countries, it is a simple formula. Countries = Distinct('Transactions'[COUNTRY]) This works perfect--No issues and yes there are multiple AND duplic...
- Anonymous9 years ago
You could do it in Power Query with something like this:
let Source = Transactions, KeptOnlyCountryAndRegion = Table.SelectColumns(Source,{"Country", "Region"}), RemovedBlankCountries = Table.SelectRows(KeptOnlyCountryAndRegion, each [Country] <> ""), RemovedDuplicateCountryandRegions = Table.Distinct(RemovedBlankCountries) in RemovedDuplicateCountryandRegions
Anonymous
9 years agoNot applicable
Your "Country Formula" is a Table, and the "Region Formula" is a measure.
Try change your "Distinct Countries Table Formula" to this:
Countries = Distinct( SELECTCOLUMNS(Transactions;"Country Slicer";[Country];"Region Slicer";[Region]) )
lcasey
Post Prodigy
9 years agoHello,
This worked as expected, But I am still getting a relation error due to there being Blanks in the data, Unfortunatly, I cant change the dataset and the dataset contains years of previous mispellings etc. The Current Data though is always correctly entered.
Is there a way to filter out Blank Countries as I need to relate tables based on countries? I am trying to Avoid creating a manual table that needs to be updated.
Countries = Distinct( SELECTCOLUMNS(Transactions,"Country Slicer",[Country],"Region Slicer",[Region]) )