Forum Discussion
zzzsharepoint
Helper I
3 years agoCalculate cost based on category from different table
We have 3 tables in power Bi. First table has column Cluster, Category and Cost. Cluster Category Cost...
Anonymous
3 years agoNot applicable
Hi zzzsharepointk,
You can create a new table with time series and non-time series two types. Then you can extract the current type and add switch in your formula to calculated with different fields based on the type values.(you can add new table field to table visual 'visual level filter' to filter records)
formual =
VAR currType =
SELECTEDVALUE ( NewTable[Type] )
RETURN
CALCULATE (
SWITCH (
currType,
"timeseries", MAX ( Table2[Blow ratio] ),
"non-timeseries", MAX ( Table2[Non-Blow ratio] )
),
ALLSELECTED ( Table2 ),
VALUES ( Table2[Cluster] ),
VALUES ( Table2[Projects] )
)
* CALCULATE (
SUM ( Table1[Cost] ),
ALLSELECTED ( Table1 ),
VALUES ( Table2[Cluster] ),
VALUES ( Table1[Category] )
)
Regards,
Xiaoxin Sheng
- zzzsharepoint3 years ago
Helper I
Can you please show and tell?
- zzzsharepoint3 years ago
Helper I
Anonymous What do you mean by creating new type in New table? what is that?