Forum Discussion
Multiple Flags for same Reference Number
- Anonymous2 years ago
Hi Lachlanpap ,
If I understand correctly, blank, provisional and final are sequential. I'm assuming the raw data looks like this;PowerQuery M:
let Source = Table, #"Grouped Rows" = Table.Group(Source, {"reference number"}, {{"Data", each Table.LastN(_, 1)}}), #"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"flags"}, {"flags"}) in #"Expanded Data"Dax:
first create a new enter table:
then relationship:
then please create a new measure:
Measure = VAR __cur_sort = CALCULATE( MAX('DimFlag'[FlagSort]), CROSSFILTER('Table'[flags],'DimFlag'[flags],Both)) VAR __max_sort = CALCULATE( MAX('DimFlag'[FlagSort]), CROSSFILTER('Table'[flags],'DimFlag'[flags],Both) ,ALLEXCEPT('Table','Table'[reference number]),VALUES('Table'[reference number])) VAR __result = IF( __cur_sort = __max_sort, 1) RETURN __resultand use it as table visual's filter:
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 Lachlanpap ,
If I understand correctly, blank, provisional and final are sequential. I'm assuming the raw data looks like this;
PowerQuery M:
let
Source = Table,
#"Grouped Rows" = Table.Group(Source, {"reference number"}, {{"Data", each Table.LastN(_, 1)}}),
#"Expanded Data" = Table.ExpandTableColumn(#"Grouped Rows", "Data", {"flags"}, {"flags"})
in
#"Expanded Data"
Dax:
first create a new enter table:
then relationship:
then please create a new measure:
Measure =
VAR __cur_sort = CALCULATE( MAX('DimFlag'[FlagSort]), CROSSFILTER('Table'[flags],'DimFlag'[flags],Both))
VAR __max_sort = CALCULATE( MAX('DimFlag'[FlagSort]), CROSSFILTER('Table'[flags],'DimFlag'[flags],Both) ,ALLEXCEPT('Table','Table'[reference number]),VALUES('Table'[reference number]))
VAR __result = IF( __cur_sort = __max_sort, 1)
RETURN
__result
and use it as table visual's filter:
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
- Lachlanpap2 years agoFrequent Visitor
Wow, thank you very much. I used option 2 and it worked perfectly. I am now going to study the syntax in the measure. Really appreciate your help 😀