Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello All,
I am a newish user and I have been trying to figure this out for a couple days, so I would appreciate all the help I can get.
Sorting by Date (Oldest to Newest), I would like to remove the last 4 entries for each Item. The Dates are different for each Item, so I couldn't just unpivot and remove the rows. The Items # and name will change so I don't think I can just separate them into their own queries?
Thank you in advance for your help.
| Date | Item | Amount |
| 1/1/2019 | Madison | 14,595 |
| 2/1/2019 | Madison | 11,342 |
| 3/1/2019 | Madison | (3,412) |
| 4/1/2019 | Madison | 13,889 |
| 5/1/2019 | Madison | 3,393 |
| 6/1/2019 | Madison | 54,189 |
| 7/1/2019 | Madison | 26,452 |
| 8/1/2019 | Madison | 1,413 |
| 9/1/2019 | Madison | 29,344 |
| 1/1/2019 | Blake | 17,918 |
| 2/1/2019 | Blake | 17,990 |
| 3/1/2019 | Blake | 17,982 |
| 4/1/2019 | Blake | 17,984 |
| 5/1/2019 | Blake | (262,889) |
| 6/1/2019 | Blake | 71,844 |
| 1/1/2019 | Atrium | 5,388 |
| 2/1/2019 | Atrium | 5,389 |
| 3/1/2019 | Atrium | (982,410) |
| 4/1/2019 | Atrium | (3,273) |
| 5/1/2019 | Atrium | 104,967 |
| 6/1/2019 | Atrium | 104,968 |
| 7/1/2019 | Atrium | 76,594 |
| 8/1/2019 | Atrium | 66,725 |
| 1/1/2019 | Daybreak | 147,521 |
| 2/1/2019 | Daybreak | 147,710 |
| 3/1/2019 | Daybreak | 147,690 |
| 4/1/2019 | Daybreak | 147,713 |
Solved! Go to Solution.
In DAX you could add a calculated column to COUNT per category e.g.
Column = VAR _Item = Hotel[Item]
VAR _Day = Hotel[Date]
RETURN
CALCULATE(COUNT(Hotel[Item]), FILTER(Hotel, Hotel[Date] <= _Day && Hotel[Item] = _Item ))And then create a new table by filtering (where Column > x )
NewTable = FILTER(Hotel, Hotel[Column] > 4)
In DAX you could add a calculated column to COUNT per category e.g.
Column = VAR _Item = Hotel[Item]
VAR _Day = Hotel[Date]
RETURN
CALCULATE(COUNT(Hotel[Item]), FILTER(Hotel, Hotel[Date] <= _Day && Hotel[Item] = _Item ))And then create a new table by filtering (where Column > x )
NewTable = FILTER(Hotel, Hotel[Column] > 4)
thank you for your help.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 37 | |
| 34 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 70 | |
| 37 | |
| 35 | |
| 25 |