Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
CTH2022
Frequent Visitor

Table showing incorrect total

data.JPGtableJPG.JPG

Total is incorrect. Need help to fix the issue.

7 REPLIES 7
BIswajit_Das
Super User
Super User

Hello @CTH2022 try this out
V1.PNG

X2.PNG

X3.PNG

X4.PNG

Updated the data and table only show 1 row for station S1. Table still unable to show top 2 for each station.

 

CTH2022_1-1687443953935.png

ProgramSTATIONTYPE
AS1F6
AS1F6
AS2F2
AS2F2
AS1F3
AS2F3
AS2F3
AS1F2
AS1F3
AS2F2
AS2F2
AS1F1
AS1F1
AS2F1
BS2F3
BS1F3
BS2F3
BS2F3
BS1F3
BS1F3
BS2F3
BS2F3
AS1F1
AS1F1
AS2F2
AS2F2
AS1F3
AS2F3
AS2F3
AS1F2
AS1F3
AS2F2
AS2F2
AS1F1
AS1F1
AS2F1
BS2F3
BS1F4
BS2F4
BS2F5
BS1F4
BS1F4
BS2F5
BS2F3

Thanks..but still having issue when the data is updated, only Top 1 is shown for station S1.

 

CTH2022_0-1687425660311.png

Program STATION TYPE
A S1 F6
A S1 F6
A S2 F2
A S2 F2
A S1 F3
A S2 F3
A S2 F3
A S1 F2
A S1 F3
A S2 F2
A S2 F2
A S1 F1
A S1 F1
A S2 F1
B S2 F3
B S1 F3
B S2 F3
B S2 F3
B S1 F3
B S1 F3
B S2 F3
B S2 F3
A S1 F1
A S1 F1
A S2 F2
A S2 F2
A S1 F3
A S2 F3
A S2 F3
A S1 F2
A S1 F3
A S2 F2
A S2 F2
A S1 F1
A S1 F1
A S2 F1
B S2 F3
B S1 F4
B S2 F4
B S2 F5
B S1 F4
B S1 F4
B S2 F5
B S2 F3

BIswajit_Das
Super User
Super User

Hello @CTH2022 can you share the table data instead of the image that would be really helpfull.

ProgramSTATIONTYPE
AS1F1
AS1F1
AS2F2
AS2F2
AS1F3
AS2F3
AS2F3
AS1F2
AS1F3
AS2F2
AS2F2
AS1F1
AS1F1
AS2F2
BS2F3
BS1F3
BS2F3
BS2F3
BS1F3
BS1F3
BS2F3
BS2F3

 

counting = countax(Sheet1,[TYPE])
 
top 2 =
var rankingcontext = values(Sheet1[TYPE])
return
calculate([counting],
topn(2,all(Sheet1[TYPE]),
[counting]),rankingcontext)
 
Wanted to table to show top 2 'TYPE' for each station.

@CTH2022 , Try like

 

top 2 =
var rankingcontext = values(Sheet1[TYPE])
return
Sumx(Summarize(Sheet1, Sheet1[STATION], Sheet1[Program], "_1",
calculate([counting],
topn(2,all(Sheet1[TYPE]),
[counting]),rankingcontext)),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

The solution seems to work. However, when I added more data, the table started to display more than top 2 per station. Need help to fix this.

ProgramSTATIONTYPE
AS1F1
AS1F1
AS2F2
AS2F2
AS1F3
AS2F3
AS2F3
AS1F2
AS1F3
AS2F2
AS2F2
AS1F1
AS1F1
AS2F1
BS2F3
BS1F3
BS2F3
BS2F3
BS1F3
BS1F3
BS2F3
BS2F3
AS1F1
AS1F1
AS2F2
AS2F2
AS1F3
AS2F3
AS2F3
AS1F2
AS1F3
AS2F2
AS2F2
AS1F1
AS1F1
AS2F1
BS2F3
BS1F4
BS2F4
BS2F5
BS1F4
BS1F4
BS2F5
BS2F3

CTH2022_0-1687397995633.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.