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 wonder if someone can help me with the DAX for a Measure.
I have a target field in a Matrix that doesn't seem to be calculating correctly. See below
In the first level grouping the values are correct, but not in the top grouping or for the grand total.
The Target is a running total for the month grouped by Program, so should be the sum of all the Target values in the top level group and for the grand total.
The DAX I'm using is fairly simple. Uses 2 measures.
[TargetWholeNumber] = SUMX(DISTINCT(DimDate[MonthName]), FIRSTNONBLANK(MeasureData[Target], 0))
Any advise will be appreciated.
Cheers,
[TargetWholeNumber] = SUMX(DISTINCT(DimDate[MonthName]), FIRSTNONBLANK(MeasureData[Target], 0))
Using FIRSTNONBLANK you add only one value per month to the total. Thus, in the grand total rows, the total can only be the sum of one subcatrgory, not of all.
What about wrting
[TargetWholeNumber] = SUM(MeasureData[Target])
instead?
Thanks for your reply, but using the Sum won't work. The target amount is repeated for each measure values. Using a sum will multiple the target amount. I just need to find a way to sum up the group values and grand total amount.
What about setting a month filter on the visual in addition?
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
10 |
User | Count |
---|---|
19 | |
16 | |
14 | |
11 | |
9 |