Forum Discussion
Help with Sorting
- 2 years ago
I did a reboot, and now it works as expected. Didn't change anything, so was glitchin the martrix for a bit I guess.
Is that first Line Item a BLANK() or an empty string?
- Koy2 years ago
Helper I
I am using this table to help format this measure as a P&L view similar to this which uses the second table I screenshotted that had no issues....
Gross to Net OL =VAR _disc = CALCULATE(SUMX('1_BPC','1_BPC'[FIN_DATA]),'5_AcctRef'[Account Number]="6541303") / [FX]RETURNswitch(SELECTEDVALUE('Gross to Net'[Category]),"Gross Sales",if(HASONEVALUE('Gross to Net'[Line Item]),Switch(SELECTEDVALUE('Gross to Net'[Line Item]),"Discount",format(_disc / [Units] *1000,[format2]),"Buydown",format([BD]/[Units]*1000,[format2])),format([GS] / [Units]*1000,[format2])),"Price, net",if(HASONEVALUE('Gross to Net'[Line Item]),Switch(selectedvalue('Gross to Net'[Line Item]),"Key Acct",format([KA]/[Units]*1000,[format2]),"SMP",format([SMP]/[Units]*1000,[format2]),"Coupon",format([Coup]/[Units]*1000,[format2]),"WHS Terms",format(([To Customer] - _disc)/[Units]*1000,[format2]),"Retail Prgm",format([To Store]/[Units]*1000,[format2]),"FET",format([FET]/[Units]*1000,[format2])),format(([GS]+[BD]+ _disc) / [Units] *1000,[format2])),"Net Revenue",format([NR]/[Units]*1000,[format2])) - Koy2 years ago
Helper I
Using it to make a table like the below using measures like this
Gross to Net OL =VAR _disc = CALCULATE(SUMX('1_BPC','1_BPC'[FIN_DATA]),'5_AcctRef'[Account Number]="6541303") / [FX]RETURNswitch(SELECTEDVALUE('Gross to Net'[Category]),"Gross Sales",if(HASONEVALUE('Gross to Net'[Line Item]),Switch(SELECTEDVALUE('Gross to Net'[Line Item]),"Discount",format(_disc / [Units] *1000,[format2]),"Buydown",format([BD]/[Units]*1000,[format2])),format([GS] / [Units]*1000,[format2])),"Price, net",if(HASONEVALUE('Gross to Net'[Line Item]),Switch(selectedvalue('Gross to Net'[Line Item]),"Key Acct",format([KA]/[Units]*1000,[format2]),"SMP",format([SMP]/[Units]*1000,[format2]),"Coupon",format([Coup]/[Units]*1000,[format2]),"WHS Terms",format(([To Customer] - _disc)/[Units]*1000,[format2]),"Retail Prgm",format([To Store]/[Units]*1000,[format2]),"FET",format([FET]/[Units]*1000,[format2])),format(([GS]+[BD]+ _disc) / [Units] *1000,[format2])),"Net Revenue",format([NR]/[Units]*1000,[format2])) - lbendlin2 years ago
Super User
No, i mean in the reference/sort table, not in the fact table.
- Koy2 years ago
Helper I
It does not. Sorry I am new to all this, but here is what the output looks like. My replies keep getting deleted as SPAM for some reason.
Based on this measure for the first column...
- lbendlin2 years ago
Super User
You seem to be mixing topics. Your original question was about the sorting issue?
- Koy2 years ago
Helper I
Sorry, misunderstood. The first line item is just an empty cell.
- lbendlin2 years ago
Super User
Try without it. I don't think you can sort by BLANK()