Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I want to create another table based on the premise that will include all the ClaimSeriesNumber and when there is a duplicate ClaimSeriesNumber only those with status Refiled will be included in the new table?
Solved! Go to Solution.
Hi @Boopep,
I have reproduced your scenario in Power BI Desktop. You can achieve this by creating a new table that filters based on duplicates and status.
Here’s one way using DAX:
NewTable =
VAR WithCounts =
ADDCOLUMNS (
Claims,
"CountPerSeries",
CALCULATE ( COUNTROWS ( Claims ), ALLEXCEPT ( Claims, Claims[ClaimSeriesNumber] ) )
)
RETURN
FILTER (
WithCounts,
[CountPerSeries] = 1 || ( [CountPerSeries] > 1 && Claims[Status] = "Refiled" )
)
This logic will:
I tested this with sample data and got the expected result:
For your reference, I am attaching .pbix file and thank you, @Ilgar_Zarbali , @MohamedFowzan1 & @Shahid12523 for sharing your valuable insights.
Best regards,
Ganesh Singamshetty.
Hello @Boopep,
Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.
Thank you for being part of the Microsoft Fabric Community.
Hello @Boopep,
Hope everything’s going great with you. Just checking in has the issue been resolved or are you still running into problems? Sharing an update can really help others facing the same thing.
Thank you.
Hello @Boopep,
We hope you're doing well. Could you please confirm whether your issue has been resolved or if you're still facing challenges? Your update will be valuable to the community and may assist others with similar concerns.
Thank you.
Hi @Boopep,
I have reproduced your scenario in Power BI Desktop. You can achieve this by creating a new table that filters based on duplicates and status.
Here’s one way using DAX:
NewTable =
VAR WithCounts =
ADDCOLUMNS (
Claims,
"CountPerSeries",
CALCULATE ( COUNTROWS ( Claims ), ALLEXCEPT ( Claims, Claims[ClaimSeriesNumber] ) )
)
RETURN
FILTER (
WithCounts,
[CountPerSeries] = 1 || ( [CountPerSeries] > 1 && Claims[Status] = "Refiled" )
)
This logic will:
I tested this with sample data and got the expected result:
For your reference, I am attaching .pbix file and thank you, @Ilgar_Zarbali , @MohamedFowzan1 & @Shahid12523 for sharing your valuable insights.
Best regards,
Ganesh Singamshetty.
You want to create another table in Power BI that:
In Power BI you have two options:
A. Power Query (M)
* If the grouped table has only one row → expand all rows (keep it).
If the grouped table has >1 rows → filter it down to Status = "Refiled".
M code pattern:
let
Source = Claims,
Grouped = Table.Group(Source, {"ClaimSeriesNumber"},
{{"AllRows", each _, type table [ClaimSeriesNumber=..., Status=...]}}),
AddFiltered = Table.AddColumn(Grouped, "Filtered", each
if Table.RowCount([AllRows]) = 1
then [AllRows]
else Table.SelectRows([AllRows], each [Status] = "Refiled")
),
RemoveOthers = Table.RemoveColumns(AddFiltered,{"AllRows"}),
Expanded = Table.ExpandTableColumn(RemoveOthers,"Filtered",{"ClaimSeriesNumber","Status"})
in
Expanded
That gives you exactly the table you want.
B. DAX (Calculated Table)
If you prefer DAX, create a new table:
FilteredClaims =
VAR WithCounts =
ADDCOLUMNS (
Claims,
"SeriesCount", CALCULATE ( COUNTROWS ( Claims ), ALLEXCEPT ( Claims, Claims[ClaimSeriesNumber] ) )
)
RETURN
FILTER (
WithCounts,
-- Keep all singletons
[SeriesCount] = 1
||
-- If duplicates, keep only Refiled
( [SeriesCount] > 1 && Claims[Status] = "Refiled" )
)
This gives you a new physical table in the model.
Result:
I hope it will help
Hi @Boopep
You can do this by counting the distinct value and adding the status filter if more than 1:
NewTable =
VAR _dupes =
ADDCOLUMNS(
SUMMARIZE(Claims, Claims[ClaimSeriesNumber]),
"DupCount", CALCULATE(COUNTROWS(Claims))
)
RETURN
FILTER(
Claims,
VAR CurrCount =
CALCULATE(
COUNTROWS(Claims),
Claims[ClaimSeriesNumber] = EARLIER(Claims[ClaimSeriesNumber])
)
RETURN
CurrCount = 1
|| (
CurrCount > 1
&& Claims[Status] = "Refiled"
)
)
If you would not like to use the "Earlier" function incase your model is huge then try this:
NewTable =
FILTER (
ADDCOLUMNS (
Claims,
"DupCount", CALCULATE ( COUNTROWS ( Claims ), ALLEXCEPT ( Claims, Claims[ClaimSeriesNumber] ) )
),
[DupCount] = 1
|| ( [DupCount] > 1 && Claims[Status] = "Refiled" )
)
Create a new table that includes:
- All rows with unique ClaimSeriesNumber
- Only rows with duplicate ClaimSeriesNumber where Status = "Refiled"
Use DAX like this:
FilteredClaims =
VAR SeriesCount =
ADDCOLUMNS (
SUMMARIZE ( Claims, Claims[ClaimSeriesNumber] ),
"Count", CALCULATE ( COUNTROWS ( Claims ) )
)
RETURN
FILTER (
Claims,
LOOKUPVALUE (
SeriesCount[Count],
SeriesCount[ClaimSeriesNumber],
Claims[ClaimSeriesNumber]
) = 1
|| Claims[Status] = "Refiled"
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |