Forum Discussion
Unable to Replace Column data in Matrix Using Switch
Dear All
I have been trying to replicate the revenue statement in Power BI directly linked with a trial balance. However once i insert a format and link multi level data into Power BI, I am unable to replace blank cells with specific data calculated with a measure.
here is the rundown of structure
1) a Sample format data with a column to sort and a column to link with master data
2) master data to link trial with sample format
3) trial balance
Now I need to calculate Total Sale and bunch of other blanks (i have removed subtotal for obvious reasons) and then insert in the Matrix
However, Unable to get this done
Switch data =
SWITCH(
SELECTEDVALUE('MIS Format'[Line Item Desc]),"Total Sale",[Total Sales]
,[PL Amount]
)
Any help would be appreciatedplace to replace
Any help is appreciated. There is even more issues but this breakthrough would be enough to have a start.
Thanks in advance
Link to Power Bi File
https://drive.google.com/file/d/185GF_modCuqKrP0RNCdfT34kjlxAwlAz/view?usp=drive_link
10 Replies
- abhifxFrequent Visitor
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
- danextianSuper User
- abhifxFrequent Visitor
That is the problem, the total sales is also going to respective sales head instead of switching to Total Sales
- abhifxFrequent Visitor
Hi amitchandak, was trying to follow your tutorial online however not able to achieve the same result. If you may help in this regard?
- abhifxFrequent Visitor
hi danextian , sorry for delayed reply. Getting in to quarterly review meetings.
So about the switch function, i am now able to get sub totals as per desired format, however, when the report is drilled down then total is lost. how to fix that?
below the witch function
Switch Subtotal = SWITCH( SELECTEDVALUE('MIS Format'[Line Item Desc]), "Total Sale",[Total Sales], "Total Variable Cost",[Total Variable Cost], "Total COGS Without VC",[Total COGS Without VC], "Total COGS", [Total COGS], "Gross Profit",[Gross Profit], [Total Trial] )