Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am new to Power BI. I have a table named 'Mobile Sales Data' having two columns 'Sales Date' and 'Total Sale' as shown here. Its date wise sale amount.
I want to show -
1. First 5 rows i.e. 09,09,09,10,10 October 2021 records ( from sale amount 61,048.20 to 1.27.819.90) datewise with Total Sale. I tried a lot but not getting required output. Kindly provide me DAX .
Thank You.
Solved! Go to Solution.
If you want to create a measure to filter the first 5 rows in a visual, you can use the following DAX formula:
DAX
First5RowsMeasure =
IF(
RANKX(
ALL('Mobile Sales Data'),
'Mobile Sales Data'[Sales Date],
,
ASC
) <= 5,
1,
0
)
You can then use this measure in your visual filters to show only the rows where First5RowsMeasure equals 1.
Proud to be a Super User! |
|
Hi @amolgharge ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @amolgharge ,
We noticed we haven't received a response from you yet, so we wanted to follow up and ensure the solution we provided addressed your issue. If you require any further assistance or have additional questions, please let us know.
Your feedback is valuable to us, and we look forward to hearing from you soon.
Hi @amolgharge ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @amolgharge ,
Thank you for reaching out to the Microsoft Fabric Community.
1. Load your data into Power BI.
2. Add Index Column
→ Go to Transform Data → Add Column → Index Column → From 1
3. Create Calculated Column in Data View
DAX:
ShowFirst5 = IF('Mobile Sales Data'[Index] <= 5, 1, 0)
4. Add a Table Visual
→ Add Sales Date and Total Sale
5. In the Filters on this visual pane:
Drag ShowFirst5 into the filter area.
Set the filter to "is 1".
FYI:
If my response solved your query, please mark it as the Accepted solution to help others find it easily.
And if my answer was helpful, I'd really appreciate a 'Kudos'.
If you want to create a measure to filter the first 5 rows in a visual, you can use the following DAX formula:
DAX
First5RowsMeasure =
IF(
RANKX(
ALL('Mobile Sales Data'),
'Mobile Sales Data'[Sales Date],
,
ASC
) <= 5,
1,
0
)
You can then use this measure in your visual filters to show only the rows where First5RowsMeasure equals 1.
Proud to be a Super User! |
|
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
6 | |
5 |
User | Count |
---|---|
17 | |
14 | |
10 | |
9 | |
6 |