dynamic data filtering
3 TopicsHELP Please: Show the Data But Not All the Details (Data Filtering Based on USERPRINCIPALNAME?)
Hello, I have a table that shows production and I would like all employees to see everyone's production but only see their own name (the rest of the names should be blank). This I have achieved using this DAX below. However, if the user logged in is a supervisor (the Employees table has a Supervisor column with a Yes or No value), there should be no filters and he/she should see all data. In the screenshot below, if Princess Leia is a supervisor, she should see all the Employee Names. Also, the supervisor may or may not have production numbers in the table. Any suggestions for how to do this? I would appreciate any help please. EmployeeName = IF( SUM('Production'[Quantity]) && SELECTEDVALUE('Employees'[LogInEmail])=USERPRINCIPALNAME(), SELECTEDVALUE('Employees'[Name]) ) Here's how it looks - Darth Vader is the user currently logged in. After I took this screenshot, I made Darth Vader a Supervisor and I want all the Employee Names to display instead of just his own name. Data tables: Employees: Production: I thought about maybe having a separate Supervisor table that contains a list of supervisors? Thanks in advance!800Views0likes3CommentsDate Range based on Slicer selection
Hello - I'm looking to return a list of the previous "X" days based on a selected day from a slicer. For example, once a day is selected in the 'Date' slicer, I want to return the date range in the visualization for the previous 180 days up to the selected day. In simple words, the logic would be something like the below, but I cannot make it work: IF ( Date >= SELECTEDVALUE ( Date )-180 || Date <= SELECTEDVALUE ( Date ) , Date , blank() ) And then use 'Date' in the visualization and exclude blanks. Any recommendation is more than welcome, thanks!!Solved1.9KViews0likes6CommentsBar Chart using only data entrys with highes Value
I have a small data set ("Sheet1") that contains transactions. A transaction is definied by a customer who buys something - however it is not important who sold the product. The seller column is called "used in company". Each transactions has a Transcation ID ("Tx-ID") and is associated with a Quantity of sold products ("Quantity"), a special profitability measure ("affordability") and a basic CM1 value ("CM1"). Customer and product info is not included. Now, since transactions can have different sellers (or "used in companies") - some transactions occur multiple times in the data set. These double transactions differ only in the affordability and CM1. When working with the data, only those transactions with the highest affordability should be considered. However, this should be done with regards to one or multiple used in companies that the user has selected. As an example, we have the following line items: Affordability used in company Tx-ID Quantity CM1 month 230 New York 1 300 1000 January 10 Berlin 1 300 200 January 20 Berlin 2 400 2000 January For used in company = New York & Berlin, CM1=3000 and Quantity = 700. For used in company = Berlin, CM1 = 2200 and Quantity = 700 Now what I want to do is create a stacked bar chart, with: - Y-Axis: CM1 - X-Axis: month & Tx-ID (to show a consolidated picture while still allowing for a drill down) - Legend: Used in company So sticking to the example from above: On the consolidated monthly view, having all companies selected, the chart should display CM1 of 3000 (since only the CM1 associated with the higest affordability per Tx-ID is considered) with a 2000:1000 split. When jumping to the Tx-ID level, I want to see two Transactions, where Tx-ID 1 belongs to New York and Tx-ID 2 belongs to Berlin. This chart should also be adaptive to a "used in company"-slicer: Thus, used in company = Berlin, Tx-ID 1 as well as Tx-ID 2 should be associated with Berlin (since now for both transactions Berlin has the highest affordability) and on a consolidated view, the CM1 should be 2200. How can I achieve that? Thanks a lot for some wise advice!Solved658Views0likes3Comments