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.
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?
Solved! Go to Solution.
@Anonymous , try using isinscope along with hasonevalue
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
@Anonymous , try using isinscope along with hasonevalue
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
Thanks a lot! The solution worked like a charm 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
42 | |
39 | |
19 | |
19 |