Forum Discussion
Anonymous
6 years agoNot applicable
Power BI Matrix Row Calculations
Here is my source data: Here is the matrix I am trying to create in Power BI: I am running into a few issues such as performing the Count/Sale calculation and assigning diff...
- 6 years ago
Hi Anonymous ,
Create this measure to show the result:
avg = VAR _sale = CALCULATE ( SUM ( test[Value] ), ALLEXCEPT ( 'test', test[Year], test[Region] ) ) VAR _count = CALCULATE ( SUM ( 'test'[Value] ), ALLEXCEPT ( test, test[Year], test[Region] ), 'test'[Measure] = "Count" ) RETURN IF ( ISINSCOPE ( 'test'[Measure] ), IF ( SELECTEDVALUE ( 'test'[Measure] ) = "Count" || SELECTEDVALUE ( 'test'[Measure] ) = "Sale", SUM ( 'test'[Value] ), _sale / _count ), SUM ( test[Value] ) + _sale / _count )Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
6 years agoSuper User
Anonymous , refer if this can help
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
https://www.sqlbi.com/articles/clever-hierarchy-handling-in-dax/