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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
2 REPLIES 2
amitchandak
Super User
Super User

Anonymous
Not applicable

Thanks a lot! The solution worked like a charm 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors