Forum Discussion
Unable to Replace Column data in Matrix Using Switch
Hi danextian , Thanks for the reply, I did check for white spaces, however, that doesnt seems to be the case.
Below is the link for BI File
https://drive.google.com/file/d/185GF_modCuqKrP0RNCdfT34kjlxAwlAz/view?usp=drive_link
- abhifx2 years agoFrequent Visitor
I might have responded against the wrong reply. This is actually part of the problem as the total sales also get distributed among the sales heads. how to ignore the sub head and add the total? I also need the same to get percentage of each head against sales
- danextian2 years ago
Super User
Hi abhifx ,
The problem is that MIS Form flows to a blank category in Database for MIS which of course doesn't have an equivalent in Trial. You can't expect Power BI to know which accounts in Trial should be aggregated for Total Sale.
This measure returns a value only if Line Item Desc is SALE, not Total Sale
Total Sales = CALCULATE ( SUM ( Trial[Value in Lac] ), 'MIS Format'[Line Item Desc] = "SALE" )You can change this behaviour by using FILTER and wrapping 'MIS Format' in ALL. Your new measure would be:
Total Sales = CALCULATE ( SUM ( Trial[Value in Lac] ), FILTER ( ALL ( 'MIS Format' ), 'MIS Format'[Line Item Desc] = "SALE" ) )This wil be tedious as you'll have to do that for all measures that return blank when they shouldn't. Alternatively, you can modify MIS Format so all category items that should be included in each Line Item Desc has its own line. For example, Total Int and Dept would have a line for Fin Charges and another one for Depreciation.
- abhifx2 years agoFrequent Visitor
Dear danextian , Nailed it, it makes sense too. Thanks for going through my Power BI jungle and find out the issue.
As for the alternative suggestion, I still need to do all this manually only as this format is very rigid. But that is ok, Just a one time activity.
I have an additional query if you don't mind, I need to do two more things.
1) I want to divide each line by Total sales to get the percentage of sales as a separate column.
2) Subtract the current month from the previous month and also get the percentage variance.