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.
Hello,
I'm stumped understanding what Power BI is doing. I have a simple model:
I placed a filter on the dimension table Jobs to filter to a specific job:
I created a simple table with 4 columns from the Job Details table (Fact Table):
This is as expected. Then things go sideways when I create a simple measure:
Actual Cost = VAR ac = SUM('Job Details'[ActualCost]) RETURN IF(ac = 0, 0, ac)
Suddenly a bunch of non-related data is pulled in, what's going on?
If I drop the IF statement in the measure, it works as expected:
Actual Cost = VAR ac = SUM('Job Details'[ActualCost]) RETURN ac
It's clearly the IF in the measure driving this behavior, but why? Why is it pulling in non-related rows? Any insight is appreciated.
Hi,
What problem do you face in using the formula without the IF statement?
Hi @Anonymous
This is because you are forcing the calculation to return a value for all permutations of the dimentions, even if they have no data. Why are you trying to return a zero in this case?
User | Count |
---|---|
82 | |
72 | |
67 | |
47 | |
36 |
User | Count |
---|---|
111 | |
56 | |
50 | |
42 | |
40 |