Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi
I am new to PBI as our company has long since used Qlikview but transitioning to PBI.
I have spent a decent amount of time trying to figure this one out and while I am narrowing in on the answer I am either getting the wrong answer or errors.
I have 4 relebant fields
Worker , Approval Date, Expense ID, Amount
I am using a table and want to show Worker, Sum Amount by Approval Date Year and Distinct Count of Expense ID.
Sum Amount by Year is done.
Count Distinct Expense ID's is my problem= If the Worker has no claims in the Year the Count is 1 not zero.
Any thought that could help? I have tried various add column options and DISTINCYCOUNTNOBLANKS.
Thanks in advance,
Rob
Solved! Go to Solution.
@racer25 You need to create a measure that calculates the distinct count of Expense IDs for each worker and year, and handles cases where there are no claims correctly.
dax
DistinctExpenseCount =
VAR DistinctCount = DISTINCTCOUNT('YourTable'[Expense ID])
RETURN
IF(DistinctCount = BLANK(), 0, DistinctCount)
Proud to be a Super User! |
|
@racer25 You need to create a measure that calculates the distinct count of Expense IDs for each worker and year, and handles cases where there are no claims correctly.
dax
DistinctExpenseCount =
VAR DistinctCount = DISTINCTCOUNT('YourTable'[Expense ID])
RETURN
IF(DistinctCount = BLANK(), 0, DistinctCount)
Proud to be a Super User! |
|
Thanks so much - PBI didn't like the VAR Name of DistinctCount but a quick tweak and working. It also gave me an understanding of how to do it not just copy/[aste - appreciate the support
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
15 | |
11 | |
9 |