Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GD61
Helper III
Helper III

Value not stable

Hi,

I'm trying to do the following example:

https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-getting-started/

In the data base, Nebraska is rankig at #10

But in every report I create, Nebraska ranking displays 20. So I have 2 states ranking at 20 : Nebraska and Pennsylvania.

What did I miss? Thanks

Nebraska ranking.jpg

1 ACCEPTED SOLUTION

That was the solution

 

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

I downloaded the data from the example and created a simple table like yours and I see Nebraska as 10 in rank. What is interesting is that all of my numbers match yours except for Nebraska and both of the Nebraska numbers that I have are half of yours so it appears as if you have somehow doubled Nebraska's numbers but not sure how you did that, perhaps somewhere in your query when you were bringing in the data?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hello,

I found that Nebraska appears twice in my data base.Do you find the same issue ? 

 

Nebraska twice.jpg

Nope, only appears once in mine. That would explain it though, the default aggregation is SUM so it is adding together both of your entries, hence why your numbers for Nebraska are twice as high as mine.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I noticed that in the original database the name Nebraska appears tow times. One with the abbreviation, the other without.

I'll need to eliminate several rows at the bottom :

 

Nebraska unknown.jpg

That was the solution

 

Greg_Deckler
Super User
Super User

Can you post your formula for overall rank?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Is it his formula you need?

-------------------------------------

let
Source = Web.Page(Web.Contents("http://www.bankrate.com/finance/retirement/best-places-retire-how-state-ranks.aspx")),
Data0 = Source{0}[Data],
#"Type modifié" = Table.TransformColumnTypes(Data0,{{"Header", type text}, {"Overall rank", Int64.Type}, {"State", type text}, {"Cost of living", Int64.Type}, {"Crime rate", Int64.Type}, {"Community well-being", Int64.Type}, {"Health care quality", type text}, {"Tax rate", Int64.Type}, {"Weather", Int64.Type}}),
#"Colonnes supprimées" = Table.RemoveColumns(#"Type modifié",{"Header"}),
#"Valeur remplacée" = Table.ReplaceValue(#"Colonnes supprimées","38 (tie)","38",Replacer.ReplaceText,{"Health care quality"}),
#"Valeur remplacée1" = Table.ReplaceValue(#"Valeur remplacée","35 (tie)","35",Replacer.ReplaceText,{"Health care quality"}),
#"Valeur remplacée2" = Table.ReplaceValue(#"Valeur remplacée1","45 (tie)","45",Replacer.ReplaceText,{"Health care quality"}),
#"Valeur remplacée3" = Table.ReplaceValue(#"Valeur remplacée2","27 (tied)","27",Replacer.ReplaceText,{"Health care quality"}),
#"Type modifié1" = Table.TransformColumnTypes(#"Valeur remplacée3",{{"Health care quality", Int64.Type}}),
#"Requêtes fusionnées" = Table.NestedJoin(#"Type modifié1",{"State"},US_States,{"State Name"},"NewColumn",JoinKind.LeftOuter),
#"NewColumn développé" = Table.ExpandTableColumn(#"Requêtes fusionnées", "NewColumn", {"State Name", "State Code"}, {"NewColumn.State Name", "NewColumn.State Code"}),
#"Colonnes supprimées1" = Table.RemoveColumns(#"NewColumn développé",{"NewColumn.State Name"}),
#"Colonnes renommées" = Table.RenameColumns(#"Colonnes supprimées1",{{"NewColumn.State Code", "State Code"}})
in
#"Colonnes renommées"

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.