Forum Discussion
Measure of measure
Hi Anonymous
Sorry I forgot the possibility of same consumption over different materials. Please use below measure for Total consumption. This would not have that error.
Total consumption new =
VAR _table1 =
FILTER (
ALL ( 'Table' ),
'Table'[Plnt] = SELECTEDVALUE ( 'Table'[Plnt] )
&& 'Table'[MTyp] = SELECTEDVALUE ( 'Table'[MTyp] )
&& 'Table'[Month] = SELECTEDVALUE ( 'Table'[Month] )
)
VAR _table2 =
DISTINCT (
SELECTCOLUMNS (
_table1,
"_Material", 'Table'[Material],
"Consumption_valorization", 'Table'[Consumption valorization]
)
)
RETURN
SUMX ( _table2, [Consumption_valorization] )
Best Regards,
Jing
Hi,
this seem much better now but I've to notice that this works just if we work on a single table.
As you can imagine I can have in my model some filtert table aside.
For example, material Type or Month are actually part of a wider model that I need to filter through "star" table that drive all my model.
I have notice that this formula doesn't work with those table filter.
How can I manage this complication?
Beside that I have to notice even that I can do this job group by group but it doesnt in an overall view: you can see from this screen, In your eveluation can you even consider what it takes to make it work even from an overall point of view? this would be great!
Thanks
- v-jingzhang5 years ago
Community Support
Hi Anonymous
Are meterial type and month from some Dim tables? And you will use fields from Dim tables to filter the report? Can you provide a small example model of that as well as the relationships? And what is the current result with those table filters and what is the expected result?
Jing
- Anonymous5 years agoNot applicable
Hi,
yes I use Dim table to filter the report so i would need to set up measure basing on the star filter Dim tables.
Beside that I need to have a resoult that work even on total (the second question here over)
Thanks
- v-jingzhang5 years ago
Community Support
Hi Anonymous
The measure should also work in this model. Can you show its current result and expected result by taking some data as example?
If you use columns from Dim tables in the table visual, you can try using these columns in SELECTEDVALUE function to replace corresponding columns from Fact table. But as the tables are related, maybe the result is same.
Jing