The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I did a couple of changes in an existing report, basically I moved all transformations to SSAS tabular and created some dimension tables.
(each column represents a product per year, Value is [Value_filtered])
this was working in the old report:
the following measures are used to calculate an custom average line
Value_filtered =
//this measure is used to show only values if all filters are applied (if not all filters are applied, the visuals shows nothing)
IF (
DISTINCTCOUNT ( 'Import'[Value] ) = 1,
AVERAGE ( 'Import'[Value] ),
""
)
TotalThisYear =
//this measure 'calculates' the value of the product '* total' (which is a weighted total, calculated in another system) and for the //latest year, but only when the product is not 'MA' (because it makes no sense for this product).
//In other words: I would like to apply this value to all products to show the average line
VAR var_max_year =
MAX ( 'Import'[Year] )
RETURN
IF (
SELECTEDVALUE ( 'Import'[Fact] ) = "MA",
"",
CALCULATE (
[Value_filtered],
'Import'[Year] = var_max_year,
Product_Dim[Product] = "* Total"
)
)
Now, after my cleanup I adapted the formulas like this:
Value_filtered =
IF (
DISTINCTCOUNT ( Import_new[Value] ) = 1,
AVERAGE ( Import_new[Value] ),
""
)
TotalThisYear =
VAR var_max_year =
MAX ( Date[Year] )
RETURN
IF (
SELECTEDVALUE ( Import_new[Fact] ) = "MA",
"",
CALCULATE (
[Value_filtered],
Date[Year] = var_max_year,
Product_Dim_new[Product] = "* Total"
)
)
But, all I got is a single dot, no line:
Note: before my cleanup, year was a separate column in the Import table. Now I use year from a dimension table.
Additional information:
there is a one to many connection between the dim tables and import_new, also in the old report, there was a one to many connection between the dim and import table. Filterdirection 'both'
What I tried:
I tried lots of other things, but I can get the result of TotalThisYear (for example lets say 2 000) to be applied to all oder products as well.
Of course I can use a clustered column chart mit the average line, but this is not as flexibel as I want it to be.
can someone help me please?
Hi @whereismydata ,
It is a little difficult to find the cause of problem if there is no corresponding data and file. Could you please provide the setting of the visual object and the formula of applied measure/calculated column on it? It would be better if you could provide your sample pbix file(exclude sensitive data).
Best Regards
User | Count |
---|---|
70 | |
64 | |
61 | |
49 | |
28 |
User | Count |
---|---|
117 | |
81 | |
65 | |
55 | |
43 |