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.
The idea is to remove any duplicate value and replaced by blank and then count it once for example
if I have
Raw 1 Product A
Raw 2 Product A
Raw 3 Product A
All three product in three rows I need to count 1 record and leave the other two as blank to be like this
Raw 1 Product A = 1
Raw 2 Product A = blank
Raw 3 Product A = blank
Thanks and I waiting for someone to help me ...thnx a lot
Solved! Go to Solution.
I would suggest you add an index column in sql server for the table.Then create below two columns.
Column = CALCULATE ( COUNT ( 'Table1'[Column1] ), FILTER ( 'Table1', 'Table1'[Column1] = EARLIER ( 'Table1'[Column1] ) && 'Table1'[Index] <= EARLIER ( 'Table1'[Index] ) ) )
Column 2 = IF(Table1[Column]=1,1,BLANK())
Regards,
You may get it in query editor as below.Please paste below formula in advanced editor to check the steps.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKTylNLlFwVIrVIY7nhJ8XCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"Partition", each Table.AddIndexColumn(_, "Index",1,1), type table}}), #"Expanded Partition" = Table.ExpandTableColumn(#"Grouped Rows", "Partition", {"Index"}, {"Partition.Index"}), #"Added Conditional Column" = Table.AddColumn(#"Expanded Partition", "Custom", each if [Partition.Index] = 1 then 1 else null) in #"Added Conditional Column"
Regards,
Thanks a lot for the solution by using advancer editor, but the issue in my data that I'm using a data table and I do not have permission to access the edit query as we are using SQL server datasets, so the only solution that I have to use DAX formula giving the same purpose
Is DAX formula applicable to my logical MS excel formula?
Thanks again
I would suggest you add an index column in sql server for the table.Then create below two columns.
Column = CALCULATE ( COUNT ( 'Table1'[Column1] ), FILTER ( 'Table1', 'Table1'[Column1] = EARLIER ( 'Table1'[Column1] ) && 'Table1'[Index] <= EARLIER ( 'Table1'[Index] ) ) )
Column 2 = IF(Table1[Column]=1,1,BLANK())
Regards,
Hello @Ahmed_Mohamed
The challenge is that in PowerBI "cell" C2 (the one with the second formula) has no idea what is in any of the other cells.
In your data, what is making the Product appear multiple times? What is different on row 2 and 3? We might be able to use that information along with IF and DISTINCTCOUNT to get what you need.
Hello jdbuchanan71,
Referring to your point@ the different in Raw 2 and Raw 3 is another needed data columns and is not duplicated for example product A includes 3 different SKUs, 3 different number of Orders, erc.. so I need to say I have 1 product include multiple items
@Ahmed_Mohamed If you use DISTINCTCOUNT ( table[Product] ) it will give you the correct values, even at the total level. It won't hide the value on the additional rows but may get you close to what you are looking for and will work regardless of the additional columns in your visual.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
104 | |
77 | |
73 | |
50 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |