Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
55 | |
37 | |
31 |
User | Count |
---|---|
89 | |
62 | |
61 | |
49 | |
45 |