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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.