Forum Discussion
Unable to Replace Column data in Matrix Using Switch
Hi abhifx
Have you tried checking whether it is really Total Sale or maybe there spaces before or after or there are more than one spaces between Total and Sale?
You can upload your pbix to Google or One Drive and share a public link.
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
- danextian2 years ago
Super User
- 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.