The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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 🙂
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
57 | |
32 | |
20 | |
17 | |
15 |
User | Count |
---|---|
53 | |
31 | |
30 | |
23 | |
21 |