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

Join 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.

Reply
Anonymous
Not applicable

Is there any robust way to detect if I am at the total row in a table?

Hi all,

I have a very simple setup: a MS SQL Server table Employee with one column named EmployeeName. There are only two values in this table: John, Sam.
create table Employee(EmployeeName varchar(100));
insert into Employee(EmployeeName) values ('John'), ('Sam');

I import this table into power bi report model, and the model consists of only that one table.
On the report pane I have two visualizations: a slicer and a table. The slicer is based on the EmployeeName column, the table shows the same column.
The option Total is enabled for the table so that at the very bottom I have the total row.
I need to have the next functionality in the table: for each employee I have to show the letter "d" (detail) when at a detail row, and the letter "t" (total) when at the total row.

To implement this functionality I have created a measure TheLetter = IF(HASONEVALUE(Employee[EmployeeName]), "d", "t"), and placed this measure into the table visual.
This works as expected, until I have filtered the Employee table down to one row thru the slicer. As soon as I have done it, my measure shows "d" at the total row, and this not what I wanted to show - I need to show the letter "t" at the total row no matter what.

Does anybody know if there is a robust was to accomplish that, please?

 

vp_powerbi_0-1605790025328.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try using isinscope along with hasonevalue

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , try using isinscope along with hasonevalue

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks a lot! The solution worked like a charm 🙂

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.