Forum Discussion
Need a help on filter formula
- Anonymous3 years ago
Hi Sukh-ErdeneB ,
Please create these new measures as follows.
ULF Count = CALCULATE( DISTINCTCOUNT('Table'[TimeComponent]), 'Table'[TimeComponent] = "ULF" )OL Count = CALCULATE( DISTINCTCOUNT('Table'[TimeComponent]), 'Table'[TimeComponent] = "OL" )AM Count = CALCULATE( DISTINCTCOUNT('Table'[TimeComponent]), 'Table'[TimeComponent] = "AM" )Or have a look at these steps in the PQ.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvYwMDBU0lEKLkksKgHSoT5uSrE6RIhXFpek5uKT8PdBEXfLLErFojw8sSS1iEhxIyDfOT+vpCg/B8hy9MUhga4lOCQo1DkkNMgV1VEgKd/80jy472IB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Unit = _t, TCodeDesc = _t, TimeComponent = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Unit", type text}, {"TCodeDesc", type text}, {"TimeComponent", type text}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"TCodeDesc", "TimeComponent"}, {{"Count", each Table.RowCount(Table.Distinct(_)), Int64.Type}}), #"Pivoted Column" = Table.Pivot(#"Grouped Rows", List.Distinct(#"Grouped Rows"[TimeComponent]), "TimeComponent", "Count", List.Sum) in #"Pivoted Column"Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi Sukh-ErdeneB ,
Please create these new measures as follows.
ULF Count = CALCULATE( DISTINCTCOUNT('Table'[TimeComponent]), 'Table'[TimeComponent] = "ULF" )OL Count = CALCULATE( DISTINCTCOUNT('Table'[TimeComponent]), 'Table'[TimeComponent] = "OL" )AM Count = CALCULATE( DISTINCTCOUNT('Table'[TimeComponent]), 'Table'[TimeComponent] = "AM" )
Or have a look at these steps in the PQ.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvYwMDBU0lEKLkksKgHSoT5uSrE6RIhXFpek5uKT8PdBEXfLLErFojw8sSS1iEhxIyDfOT+vpCg/B8hy9MUhga4lOCQo1DkkNMgV1VEgKd/80jy472IB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Unit = _t, TCodeDesc = _t, TimeComponent = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Unit", type text}, {"TCodeDesc", type text}, {"TimeComponent", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"TCodeDesc", "TimeComponent"}, {{"Count", each Table.RowCount(Table.Distinct(_)), Int64.Type}}),
#"Pivoted Column" = Table.Pivot(#"Grouped Rows", List.Distinct(#"Grouped Rows"[TimeComponent]), "TimeComponent", "Count", List.Sum)
in
#"Pivoted Column"
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- Sukh-ErdeneB3 years agoFrequent Visitor
thank you for your formula. It is great working.